diff --git a/src/components/Form/switch.story.vue b/src/components/Form/switch.story.vue new file mode 100644 index 0000000..1028d7b --- /dev/null +++ b/src/components/Form/switch.story.vue @@ -0,0 +1,228 @@ + + + + + +Switch is used for switching between two opposing states. + +## Basic usage + +Bind v-model to a Boolean typed variable. + +## Sizes + +Switchable buttons of different sizes + +## Text description + +You can add active-text and inactive-text attribute to show texts. use inline-prompt attribute to control text is displayed inside dot. + +You can add active-text and inactive-text attribute to show texts. + +## Display custom icons + +You can add active-icon and inactive-icon attribute to show icons. use inline-prompt attribute to control icon is displayed inside dot. + +## Extended value types + +You can set active-value and inactive-value attributes. They both receive a Boolean, String or Number typed value. + +## Disabled + +Adding the disabled attribute disables Switch. + +## Loading + +Setting the loading attribute to true indicates a loading state on the Switch. + +## prevent switching + +the before-change property, If false is returned or a Promise is returned and then is rejected, will stop switching. +