From 22bb2d7b022b58294ee950b63413fac2b8000b66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=94=B3=E5=90=9B=E5=81=A5?= <40288193@qq.com> Date: Fri, 27 Dec 2024 17:32:09 +0800 Subject: [PATCH] docs(select): add the description of the filterMethod prop for Select (#2708) --- .../demos/pc/app/select/webdoc/select.js | 20 +++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/examples/sites/demos/pc/app/select/webdoc/select.js b/examples/sites/demos/pc/app/select/webdoc/select.js index 5f92c6766f..bfd6c894a7 100644 --- a/examples/sites/demos/pc/app/select/webdoc/select.js +++ b/examples/sites/demos/pc/app/select/webdoc/select.js @@ -132,10 +132,22 @@ export default { 'en-US': 'Filterable' }, desc: { - 'zh-CN': - '

通过 filterable 属性启用搜索功能。filter-method 自定义过滤方法。 no-match-text 属性自定义与搜索条件无匹配项时显示的文字。

\n', - 'en-US': - '

Enable search functionality through the filterable attribute filter-method customize the filtering method no-match-text the text displayed when there is no match between attribute customization and search criteria.

\n' + 'zh-CN': ` + 通过 filterable 属性, 启用搜索功能。
+ 通过 filter-method 方法属性, 自定义过滤方法。
+ 通过 no-match-text 属性, 自定义与搜索条件无匹配项时显示的文字。
+
+ 在filter-method方法属性中,禁止通过修改组件的 options的个数,去控制过滤下拉列表选项。这样不匹配的Option组件会卸载,造成Select组件引用到被卸载的选项值时引发错误。正确的过滤函数应该参考本示例的用法。 +
+ `, + 'en-US': ` + Enable the search function using the filterable attribute.
+ Use the filter-method method attribute to customize the filtering method.
+ You can use the no-match-text attribute to customize the text that is displayed if there is no match with the search criteria.
+
+ In the filter-method method property, you cannot change the number of options of a component to control the filtering drop-down list options. This uninstalls the mismatched Option component, causing an error when the Select component references the uninstalled option value. The correct filter function should follow the usage in this example. +
+ ` }, codeFiles: ['filter-method.vue'] },