1.1.0 • Published 3 years ago

vue-state-switch v1.1.0

Weekly downloads
-
License
ISC
Repository
github
Last release
3 years ago

stateSwitch

开关滑块组件

仿照element-ui开关组件源码改造了一个开关滑块组件,目前只有vue2的

效果如下:

image-20210225174310770

使用方法

首先使用npm下载

npm i vue-state-switch

使用代码如下:

<template>
  <div>
    <state-switch v-model="state"/>
  </div>
</template>

<script>
import stateSwitch from 'vue-state-switch'
export default {
  components: {
    stateSwitch
  },
  data() {
    return {
      state: true
    }
  }
}
</script>

Attributes

参数说明类型默认值
value / v-model绑定值boolean / string / numbertrue
disabled是否禁用booleanfalse
openText打开的文字描述string打开
closeText关闭的文字描述string关闭
openValue打开时的值boolean / string / numbertrue
closeValue关闭时的值boolean / string / numberfalse
duration过渡时间, 秒number
1.1.0

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago