We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AutoComplete组件参数options的value属性不起作用 例如,对该组件设置options参数如下
[ { label: "a", value: "b"}]
选中该选项后,赋值的是label的值a,而不是b
a
b
访问链接查看实例 https://stackblitz.com/edit/vitejs-vite-rsps4c?file=src%2FApp.vue options中value属性不生效,还是使用label值来赋值
<template> value:{{ value }} <br /> <br /> <br /> <n-auto-complete v-model:value="value" :input-props="{ autocomplete: 'disabled', }" :options="options" placeholder="邮箱" clearable /> </template> <script lang="ts"> import { defineComponent, ref, computed } from 'vue'; import { NAutoComplete } from 'naive-ui'; export default defineComponent({ components: { NAutoComplete, }, setup() { const valueRef = ref(''); return { value: valueRef, options: computed(() => { return ['@gmail.com', '@163.com', '@qq.com'].map((suffix) => { const prefix = valueRef.value.split('@')[0]; return { label: prefix + suffix + '__label', value: prefix + suffix + '__value', }; }); }), }; }, }); </script>
https://stackblitz.com/edit/vitejs-vite-rsps4c?file=src%2FApp.vue
stackblitz.com 平台信息 System: OS: Linux 5.0 undefined CPU: (8) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz Memory: 0 Bytes / 0 Bytes Shell: 1.0 - /bin/jsh Binaries: Node: 18.18.0 - /usr/local/bin/node Yarn: 1.22.19 - /usr/local/bin/yarn npm: 10.2.3 - /usr/local/bin/npm pnpm: 8.15.3 - /usr/local/bin/pnpm npmPackages: naive-ui: ^2.38.1 => 2.38.1 vue: ^3.4.21 => 3.4.21
npm
The text was updated successfully, but these errors were encountered:
fix(auto-complete): use option prop's value instead of label fo…
option
value
label
dd6f18e
…r update value, closes tusen-ai#5794
fix(auto-complete): use option's value instead of label for updat…
b276a25
…e value, closes tusen-ai#5794
6e8594f
什么时候能发布新版本修复这个bug呢?
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
描述错误
AutoComplete组件参数options的value属性不起作用
例如,对该组件设置options参数如下
选中该选项后,赋值的是label的值
a
,而不是b
复现步骤
访问链接查看实例 https://stackblitz.com/edit/vitejs-vite-rsps4c?file=src%2FApp.vue
options中value属性不生效,还是使用label值来赋值
最小复现链接
https://stackblitz.com/edit/vitejs-vite-rsps4c?file=src%2FApp.vue
系统信息
使用的包管理器
npm
验证
The text was updated successfully, but these errors were encountered: