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

34 lines
520 B
Markdown
Raw Normal View History

2018-02-27 04:14:29 +00:00
<cn>
#### 不可用
Switch 失效状态。
</cn>
<us>
#### Disabled
Disabled state of `Switch`.
</us>
2019-10-09 10:32:23 +00:00
```tpl
2018-02-27 04:14:29 +00:00
<template>
<div>
2019-09-28 12:45:07 +00:00
<a-switch defaultChecked :disabled="disabled" style="margin-bottom:5px" />
<br />
<a-button type="primary" @click="onToggle">Toggle disabled</a-button>
2018-02-27 04:14:29 +00:00
</div>
</template>
<script>
export default {
2019-09-28 12:45:07 +00:00
data() {
2018-02-27 04:14:29 +00:00
return {
disabled: true,
2019-09-28 12:45:07 +00:00
};
2018-02-27 04:14:29 +00:00
},
methods: {
2019-09-28 12:45:07 +00:00
onToggle() {
this.disabled = !this.disabled;
},
2018-02-27 04:14:29 +00:00
},
2019-09-28 12:45:07 +00:00
};
2018-02-27 04:14:29 +00:00
</script>
```