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

37 lines
608 B
Vue
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<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>