Skip to content

Commit 22bb2d7

Browse files
authored
docs(select): add the description of the filterMethod prop for Select (#2708)
1 parent 6a65a60 commit 22bb2d7

File tree

1 file changed

+16
-4
lines changed
  • examples/sites/demos/pc/app/select/webdoc

1 file changed

+16
-4
lines changed

examples/sites/demos/pc/app/select/webdoc/select.js

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -132,10 +132,22 @@ export default {
132132
'en-US': 'Filterable'
133133
},
134134
desc: {
135-
'zh-CN':
136-
'<p>通过 <code>filterable</code> 属性启用搜索功能。<code>filter-method</code> 自定义过滤方法。 <code>no-match-text</code> 属性自定义与搜索条件无匹配项时显示的文字。</p>\n',
137-
'en-US':
138-
'<p>Enable search functionality through the <code>filterable</code> attribute <code>filter-method</code> customize the filtering method <code>no-match-text</code> the text displayed when there is no match between attribute customization and search criteria.</p>\n'
135+
'zh-CN': `
136+
通过 <code>filterable</code> 属性, 启用搜索功能。<br>
137+
通过 <code>filter-method</code> 方法属性, 自定义过滤方法。 <br>
138+
通过 <code>no-match-text</code> 属性, 自定义与搜索条件无匹配项时显示的文字。<br>
139+
<div class="danger custom-block">
140+
在<code>filter-method</code>方法属性中,禁止通过修改组件的 <code>options</code>的个数,去控制过滤下拉列表选项。这样不匹配的<code>Option</code>组件会卸载,造成<code>Select</code>组件引用到被卸载的选项值时引发错误。正确的过滤函数应该参考本示例的用法。
141+
</div>
142+
`,
143+
'en-US': `
144+
Enable the search function using the <code>filterable</code> attribute. <br>
145+
Use the <code>filter-method</code> method attribute to customize the filtering method. <br>
146+
You can use the <code>no-match-text</code> attribute to customize the text that is displayed if there is no match with the search criteria. <br>
147+
<div class="danger custom-block">
148+
In the <code>filter-method</code> method property, you cannot change the number of <code>options</code> of a component to control the filtering drop-down list options. This uninstalls the mismatched <code>Option</code> component, causing an error when the <code>Select</code> component references the uninstalled option value. The correct filter function should follow the usage in this example.
149+
</div>
150+
`
139151
},
140152
codeFiles: ['filter-method.vue']
141153
},

0 commit comments

Comments
 (0)