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
2.34.3
3.3.0-alpha.9
100
win11
https://www.naiveui.com/zh-CN/light/components/select#tag.vue
官网的例子用下就行了,比如Girl这个选项,手动输入Girl,会有一个自定义的Girl和本身存在的Girl,手动输入和options里的某个label一样的情况的时候,应该不显示自定义创建的选项了吧
1
The text was updated successfully, but these errors were encountered:
个人理解: 这个应该不算bug,在实际业务中,可以通过 指定onCreate 来生成 输入 对应的value。 因为nselect 默认是通过比较 value来做搜索,而不是label。 当然也可以指定 value-field 的比较label,但是这也会影响到最总nselect的取值。
源码逻辑片段
if (tag && !remote) { if (!value) { beingCreatedOptionsRef.value = emptyArray return } const { onCreate } = props const optionBeingCreated = onCreate ? onCreate(value) : { [props.labelField]: value, [props.valueField]: value } const { valueField } = props if ( compitableOptionsRef.value.some( (option) => option[valueField] === optionBeingCreated[valueField] ) || createdOptionsRef.value.some( (option) => option[valueField] === optionBeingCreated[valueField] ) ) { beingCreatedOptionsRef.value = emptyArray } else { beingCreatedOptionsRef.value = [optionBeingCreated] } }
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
TuSimple/naive-ui version (版本)
2.34.3
Vue version (Vue 版本)
3.3.0-alpha.9
Browser and its version (浏览器及其版本)
100
System and its version (系统及其版本)
win11
Node version (Node 版本)
Reappearance link (重现链接)
https://www.naiveui.com/zh-CN/light/components/select#tag.vue
Reappearance steps (重现步骤)
官网的例子用下就行了,比如Girl这个选项,手动输入Girl,会有一个自定义的Girl和本身存在的Girl,手动输入和options里的某个label一样的情况的时候,应该不显示自定义创建的选项了吧
Expected results (期望的结果)
1
Actual results (实际的结果)
1
Remarks (补充说明)
The text was updated successfully, but these errors were encountered: