Skip to content

Commit fc3bd1c

Browse files
committed
feat: select add filterSort virtual listHeight, close #5310
1 parent fe4c3e6 commit fc3bd1c

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

components/select/index.en-US.md

+3
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,11 @@ Select component to select value from options.
3939
| dropdownStyle | style of dropdown menu | object | - | |
4040
| fieldNames | Customize node label, value, options field name | object | { label: `label`, value: `value`, options: `options` } | 3.0 |
4141
| filterOption | If true, filter options by input, if function, filter options against it. The function will receive two arguments, `inputValue` and `option`, if the function returns `true`, the option will be included in the filtered set; Otherwise, it will be excluded. | boolean or function(inputValue, option) | true | |
42+
| filterSort | Sort function for search options sorting, see [Array.sort](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort)'s compareFunction | (optionA: Option, optionB: Option) => number | - | 3.0 |
4243
| firstActiveValue | Value of action option by default | string\|string\[] | - | |
4344
| getPopupContainer | Parent Node which the selector should be rendered to. Default to `body`. When position issues happen, try to modify it into scrollable content and position it relative. | function(triggerNode) | () => document.body | |
4445
| labelInValue | whether to embed label in value, turn the format of value from `string` to `{key: string, label: vNodes}` | boolean | false | |
46+
| listHeight | Config popup height | number | 256 | |
4547
| loading | indicate loading state | Boolean | false | |
4648
| maxTagCount | Max tag count to show | number | - | |
4749
| maxTagPlaceholder | Placeholder for not showing tags | slot/function(omittedValues) | - | |
@@ -64,6 +66,7 @@ Select component to select value from options.
6466
| tagRender | Customize tag render, only applies when `mode` is set to `multiple` or `tags` | slot \| (props) => any | - | |
6567
| tokenSeparators | Separator used to tokenize on tag/multiple mode | string\[] | | |
6668
| value(v-model) | Current selected option. | string\|number\|string\[]\|number\[] | - | |
69+
| virtual | Disable virtual scroll when set to false | boolean | true | 3.0 |
6770

6871
> Note, if you find that the drop-down menu scrolls with the page, or you need to trigger Select in other popup layers, please try to use `getPopupContainer={triggerNode => triggerNode.parentElement}` to fix the drop-down popup rendering node in the parent element of the trigger .
6972

components/select/index.zh-CN.md

+3
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,11 @@ cover: https://gw.alipayobjects.com/zos/alicdn/_0XzgOis7/Select.svg
4040
| dropdownStyle | 下拉菜单的 style 属性 | object | - | |
4141
| fieldNames | 自定义节点 label、value、options 的字段 | object | { label: `label`, value: `value`, options: `options` } | 3.0 |
4242
| filterOption | 是否根据输入项进行筛选。当其为一个函数时,会接收 `inputValue` `option` 两个参数,当 `option` 符合筛选条件时,应返回 `true`,反之则返回 `false`| boolean or function(inputValue, option) | true | |
43+
| filterSort | 搜索时对筛选结果项的排序函数, 类似[Array.sort](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort)里的 compareFunction | (optionA: Option, optionB: Option) => number | - | 3.0 |
4344
| firstActiveValue | 默认高亮的选项 | string\|string\[] | - | |
4445
| getPopupContainer | 菜单渲染父节点。默认渲染到 body 上,如果你遇到菜单滚动定位问题,试试修改为滚动的区域,并相对其定位。 | Function(triggerNode) | () => document.body | |
4546
| labelInValue | 是否把每个选项的 label 包装到 value 中,会把 Select 的 value 类型从 `string` 变为 `{key: string, label: vNodes}` 的格式 | boolean | false | |
47+
| listHeight | 设置弹窗滚动高度 | number | 256 | |
4648
| maxTagCount | 最多显示多少个 tag | number | - | |
4749
| maxTagPlaceholder | 隐藏 tag 时显示的内容 | slot/function(omittedValues) | - | |
4850
| maxTagTextLength | 最大显示的 tag 文本长度 | number | - | |
@@ -64,6 +66,7 @@ cover: https://gw.alipayobjects.com/zos/alicdn/_0XzgOis7/Select.svg
6466
| tagRender | 自定义 tag 内容 render,仅在 `mode``multiple``tags` 时生效 | slot \| (props) => any | - | 3.0 |
6567
| tokenSeparators | 在 tags 和 multiple 模式下自动分词的分隔符 | string\[] | | |
6668
| value(v-model) | 指定当前选中的条目 | string\|string\[]\|number\|number\[] | - | |
69+
| virtual | 设置 false 时关闭虚拟滚动 | boolean | true | 3.0 |
6770

6871
> 注意,如果发现下拉菜单跟随页面滚动,或者需要在其他弹层中触发 Select,请尝试使用 `getPopupContainer={triggerNode => triggerNode.parentNode}` 将下拉弹层渲染节点固定在触发器的父元素中。
6972

0 commit comments

Comments
 (0)