-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Closed
Labels
Description
- I have searched the issues of this repository and believe that this is not a duplicate.
Version
undefined
Environment
vue: 3.x ; ant-design-vue: 4.2.3
Reproduction link
a-input 组件不受控
<template>
<h1>{{ msg }}</h1>
<a-input v-model:value="msg" @input="handleChange" />
<!-- 非受控组件 -->
<a-input :value="1" />
<!-- 受控组件 -->
<a-select style="width: 100%" :value="1" :options="options" />
</template>
<script lang="ts" setup>
import { ref } from "vue";
const msg = ref();
const options = [
{ label: 1, value: 1 },
{ label: 2, value: 2 },
];
const handleChange = () => {
msg.value = "Hello";
};
</script>
What is expected?
期待 a-input 组件与 a-select 组件一样,都是受控组件
What is actually happening?
no response