<template>
  <el-switch
    v-model="value"
    :active-color="attrs.activeColor"
    :inactive-color="attrs.inactiveColor"
    :disabled="attrs.disabled"
    :width="attrs.width"
    :active-text="attrs.activeText"
    :inactive-text="attrs.inactiveText"
    :active-value="attrs.activeValue"
    :inactive-value="attrs.inactiveValue"
    @change="change"
    >
  </el-switch>
</template>

<script lang="ts">
import { Component, Prop, Vue, Watch } from "vue-property-decorator";
import VueViews from '@/benyun/compVue/VueViews';

@Component
export default class BySwitch extends VueViews {
  value:any=null;

  @Watch('propValue')
  propValueChange(v:any){

  }

  created(){
    if(this.propConfig){
      this.setConfig(this.propConfig)
    }
  }
  setValue(v:any){
    this.value = v;
  }
  getValue(){
    return this.value;
  }
  // 清空数据
  clearValue(){
    this.value = null
  }
  change(v:any){
    this.$emit('onChange',v);
  }
}
</script>

<style lang="scss" scoped>

</style>