ant-design-vue
ant-design-vue copied to clipboard
AutoComplete 自动完成-自定义选项 为什么设计成选择完选项回填到输入框时,自动前后加空格?
trafficstars
- [ ] I have searched the issues of this repository and believe that this is not a duplicate.
Version
1.7.2
Environment
browser version:87.0.4280.141
Reproduction link
https://antdv.com/components/auto-complete-cn/
Steps to reproduce
直接在文档网站即可操作出来 1、选择AutoComplete代码演示 2、查看自定义选项例子 3、输入1 4、选择下拉”[email protected]“ 5、得出输入框结果” [email protected] “
What is expected?
What is actually happening?
这样的话,如果用户想删除某些字符,得先删除一些空格,操作不太友好
<a-auto-complete
style="width: 200px"
placeholder="input here"
option-label-prop="title"
>
<template slot="dataSource">
<a-select-option v-for="email in result" :key="email" :title="email">
{{ email }}
</a-select-option>
</template>
</a-auto-complete>
</template>
这样规避一下吧
谢谢 之前暂时这么处理了
<a-auto-complete style="width: 200px" placeholder="input here" option-label-prop="title" > <template slot="dataSource"> <a-select-option v-for="email in result" :key="email" :title="email"> {{ email }} </a-select-option> </template> </a-auto-complete> </template>这样规避一下吧
试过了没有用,1.7.8 的版本,想请教下为什么这个要加 title,而不是 label 呢,label 也试过了不行。