ant-design-vue/components/input-number/demo/out-of-range.vue

37 lines
608 B
Vue
Raw Normal View History

2021-12-19 15:15:27 +00:00
<docs>
---
order: 6
title:
zh-CN: 超出边界
en-US: Out of range
---
## zh-CN
当通过受控将 `value` 超出边界时提供警告样式
## en-US
Show warning style when `value` is out of range by control.
</docs>
<template>
<a-space>
<a-input-number v-model:value="value" :min="1" :max="10" />
<a-button type="primary" @click="value = 99">Reset</a-button>
</a-space>
</template>
<script lang="ts">
import { defineComponent, ref } from 'vue';
export default defineComponent({
setup() {
const value = ref<number>(99);
return {
value,
};
},
});
</script>