当前位置: 首页> 教育> 幼教 > antd vue a-select 搜索

antd vue a-select 搜索

时间:2025/8/28 21:19:40来源:https://blog.csdn.net/qq_44603011/article/details/139526443 浏览次数:0次

数据结构 

  list: [{ name: "序号", id: 0, show: true },{ name: "出库单编号", id: 1, show: false },{ name: "wbs元素", id: 2, show: true },{ name: "序号1", id: 3, show: true },{ name: "出库单编号1", id: 4, show: false },{ name: "wbs元素1", id: 5, show: true },{ name: "序号2", id: 6, show: true },{ name: "出库单编号2", id: 7, show: false },{ name: "wbs元素2", id: 8, show: true },{ name: "序号3", id: 9, show: true },{ name: "出库单编号3", id: 10, show: false },{ name: "wbs元素3", id: 11, show: true },{ name: "序号4", id: 12, show: true },{ name: "出库单编号4", id: 13, show: false },{ name: "wbs元素4", id: 14, show: true },],

html

                <a-select v-model="state.searchValue" show-search placeholder="字段名称" class='w-[70%]':filter-option="filterOption" @change="handleChange" :options="state.list" :fieldNames="{label: 'name',value: 'id',}" allowClear></a-select>// fieldNames 配置label和value 中 在数组中使用的字段

js  搜索过滤

const filterOption = (input, option) => {return (option?.name ?? "").includes(input);};

关键字:antd vue a-select 搜索

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com

责任编辑: