XSwitch
Install

Install

  <group>
    <x-switch title="title" v-model="value"></x-switch>
  </group>

x-switch should be used in Group.


API

Props

nametypedefaultdescriptionrequired version
titlestringlabel text--
disabledbooleanfalseif disabled--
valuebooleanfalsecomponent's value, use v-model for binding--
inline-descstringdesctiption text below the label--
prevent-defaultbooleanfalseprevent from setting value on being clickedv2.5.0
value-maparray[false, true]customize not-boolean valuesv2.7.0

Events

nameparamsdescriptionrequired version
@on-change(value)triggers when value change, params is (currentValue)--
@on-click(newVal, oldVal)triggers when being clicked--
Variables

Variables

namedefaultdescriptioninherited name
@switch-checked-bg-color #04BE02 --@theme-color
@switch-checked-border-color #04BE02 --@theme-color
@switch-disabled-opacity 0.6 --
@switch-height 32px --


Contributors

Contributors

Total commits quantity: 17,Total contributors quantity: 2

airyland万刚

Changelog

Releases

  • v2.7.0 [feature] support prop:value-map #2104
  • v2.5.0 [feature] we can use prop:prevent-default to prevent from setting value on being clicked #1606