ant-design-vue/components/switch/demo/disabled.md

34 lines
515 B
Markdown
Raw Normal View History

2018-02-27 04:14:29 +00:00
<cn>
#### 不可用
Switch 失效状态。
</cn>
<us>
#### Disabled
Disabled state of `Switch`.
</us>
```html
<template>
<div>
<a-switch defaultChecked :disabled="disabled" style="margin-bottom:5px"/>
<br/>
2018-05-15 01:52:44 +00:00
<a-button type="primary" @click='onToggle'>Toggle disabled</a-button>
2018-02-27 04:14:29 +00:00
</div>
</template>
<script>
export default {
data () {
return {
disabled: true,
}
},
methods: {
onToggle(){
this.disabled = !this.disabled
}
},
}
</script>
```