UNPKG

wangbd-myui

Version:

MY前端基础框架核心组件库

39 lines (34 loc) 768 B
/** * 文本框组件,继承Base * @module $ui/components/my-switch */ import {Switch} from 'element-ui' import Base from '../Base' export default { name: 'MySwitch', mixins: [Base], components: { ElSwitch: Switch }, props: { value: [Boolean, String, Number] }, methods: { getDefaultValue() { return false } }, render() { const vnode = ( <ElSwitch ref="comp" class="my-switch" {...{props: this.innerProps, on: this.$listeners, attrs: this.innerProps}} vModel={this.fieldValue}> </ElSwitch> ) return this.renderComponent(vnode) }, mounted() { this.extendMethods(this.$refs.comp, ['focus']) } }