Switch 开关
概述
使用指南
<script>
import iSwitch from 'iview-mpvue/dist/components/switch/switch'
export default {
components: {
'i-switch': iSwitch
}
}
</script>示例
<i-cell-group>
<i-cell title="基本用法">
<i-switch :value="switch1" @change="onChange" slot="footer"></i-switch>
</i-cell>
<i-cell title="自定义内容">
<i-switch :value="switch1" size="large" @change="onChange" slot="footer">
<view slot="open">开启</view>
<view slot="close">关闭</view>
</i-switch>
</i-cell>
<i-cell title="图标">
<i-switch :value="switch1" @change="onChange" slot="footer">
<i-icon type="right" slot="open"></i-icon>
<i-icon type="close" slot="close"></i-icon>
</i-switch>
</i-cell>
<i-cell title="禁止切换">
<i-switch :value="switch1" :disabled="true" slot="footer"></i-switch>
</i-cell>
</i-cell-group>API
Last updated
Was this helpful?