ant-design-vue/components/input-number/demo/disabled.md

35 lines
603 B
Markdown
Raw Normal View History

2018-04-04 05:57:23 +00:00
<cn>
#### 不可用
点击按钮切换可用状态。
</cn>
<us>
#### Disabled
Click the button to toggle between available and disabled states.
</us>
```html
<template>
<div>
<a-input-number :min="1" :max="10" :disabled="disabled" :defaultValue="3" />
<div style="marginTop:20px">
<a-button @click="toggle" type="primary">Toggle disabled</a-button>
</div>
</div>
</template>
<script>
export default {
2019-09-28 12:45:07 +00:00
data() {
2018-04-04 05:57:23 +00:00
return {
disabled: true,
2019-09-28 12:45:07 +00:00
};
2018-04-04 05:57:23 +00:00
},
methods: {
toggle() {
2019-09-28 12:45:07 +00:00
this.disabled = !this.disabled;
},
2018-04-04 05:57:23 +00:00
},
2019-09-28 12:45:07 +00:00
};
2018-04-04 05:57:23 +00:00
</script>
```