| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- <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="attts.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
- 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>
|