You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
513 B
34 lines
513 B
7 years ago
|
<cn>
|
||
|
#### 不可用
|
||
|
Switch 失效状态。
|
||
|
</cn>
|
||
|
|
||
|
<us>
|
||
|
#### Disabled
|
||
|
Disabled state of `Switch`.
|
||
|
</us>
|
||
|
|
||
|
```html
|
||
|
<template>
|
||
|
<div>
|
||
|
<a-switch defaultChecked :disabled="disabled" style="margin-bottom:5px"/>
|
||
|
<br/>
|
||
|
<a-button type="primary" @click='onToggle'>Toggle disabled</Button>
|
||
|
</div>
|
||
|
</template>
|
||
|
<script>
|
||
|
export default {
|
||
|
data () {
|
||
|
return {
|
||
|
disabled: true,
|
||
|
}
|
||
|
},
|
||
|
methods: {
|
||
|
onToggle(){
|
||
|
this.disabled = !this.disabled
|
||
|
}
|
||
|
},
|
||
|
}
|
||
|
</script>
|
||
|
```
|