Skip to content

Commit 34e7905

Browse files
committed
doc: update
1 parent 2c54320 commit 34e7905

File tree

9 files changed

+13
-11
lines changed

9 files changed

+13
-11
lines changed

components/_util/hooks/useConfigInject.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export default (
2222
autoInsertSpaceInButton: ComputedRef<boolean>;
2323
renderEmpty?: ComputedRef<(componentName?: string) => VNodeChild | JSX.Element>;
2424
virtual: ComputedRef<boolean>;
25-
dropdownMatchSelectWidth: ComputedRef<boolean>;
25+
dropdownMatchSelectWidth: ComputedRef<boolean | number>;
2626
getPopupContainer: ComputedRef<ConfigProviderProps['getPopupContainer']>;
2727
} => {
2828
const configProvider = inject<UnwrapRef<ConfigProviderProps>>(
@@ -44,7 +44,7 @@ export default (
4444
() => props.getPopupContainer || configProvider.getPopupContainer,
4545
);
4646
const virtual = computed(() => props.virtual ?? configProvider.virtual);
47-
const dropdownMatchSelectWidth = computed<boolean>(
47+
const dropdownMatchSelectWidth = computed<boolean | number>(
4848
() => props.dropdownMatchSelectWidth ?? configProvider.dropdownMatchSelectWidth,
4949
);
5050
const size = computed(() => props.size || configProvider.componentSize);

components/auto-complete/index.en-US.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ When there is a need for autocomplete functionality.
2929
| dropdownMenuStyle | additional style applied to dropdown menu | object | | 1.5.0 |
3030
| defaultActiveFirstOption | Whether active first option by default | boolean | true | |
3131
| disabled | Whether disabled select | boolean | false | |
32+
| dropdownMatchSelectWidth | Determine whether the dropdown menu and the select input are the same width. Default set `min-width` same as input. Will ignore when value less than select width. `false` will disable virtual scroll | boolean \| number | true | |
3233
| 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 | |
3334
| optionLabelProp | Which prop value of option will render as content of select. | string | `children` | |
3435
| placeholder | placeholder of input | string | - | |

components/auto-complete/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const autoCompleteProps = {
1818
dataSource: PropTypes.array,
1919
dropdownMenuStyle: PropTypes.style,
2020
optionLabelProp: PropTypes.string,
21-
dropdownMatchSelectWidth: PropTypes.looseBool,
21+
dropdownMatchSelectWidth: { type: [Number, Boolean], default: true },
2222
};
2323

2424
export type AutoCompleteProps = Partial<ExtractPropTypes<typeof autoCompleteProps>>;

components/auto-complete/index.zh-CN.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ cover: https://gw.alipayobjects.com/zos/alicdn/qtJm4yt45/AutoComplete.svg
3636
| dropdownMenuStyle | dropdown 菜单自定义样式 | object | | 1.5.0 |
3737
| defaultActiveFirstOption | 是否默认高亮第一个选项。 | boolean | true | |
3838
| disabled | 是否禁用 | boolean | false | |
39+
| dropdownMatchSelectWidth | 下拉菜单和选择器同宽。默认将设置 `min-width`,当值小于选择框宽度时会被忽略。false 时会关闭虚拟滚动 | boolean \| number | true | |
3940
| filterOption | 是否根据输入项进行筛选。当其为一个函数时,会接收 `inputValue` `option` 两个参数,当 `option` 符合筛选条件时,应返回 `true`,反之则返回 `false`| boolean or function(inputValue, option) | true | |
4041
| optionLabelProp | 回填到选择框的 Option 的属性值,默认是 Option 的子元素。比如在子元素需要高亮效果时,此值可以设为 `value`| string | `children` | |
4142
| placeholder | 输入框提示 | string \| slot | - | |

components/config-provider/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export interface ConfigConsumerProps {
4242
size?: SizeType | number;
4343
};
4444
virtual?: boolean;
45-
dropdownMatchSelectWidth?: boolean;
45+
dropdownMatchSelectWidth?: boolean | number;
4646
}
4747

4848
export const configConsumerProps = [
@@ -144,7 +144,7 @@ export const configProviderProps = {
144144
type: Object as PropType<{ size: SizeType | number }>,
145145
},
146146
virtual: PropTypes.looseBool,
147-
dropdownMatchSelectWidth: PropTypes.looseBool,
147+
dropdownMatchSelectWidth: { type: [Number, Boolean], default: true },
148148
form: {
149149
type: Object as PropType<{ requiredMark?: RequiredMark }>,
150150
},

components/select/index.en-US.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Select component to select value from options.
3131
| defaultActiveFirstOption | Whether active first option by default | boolean | true | |
3232
| disabled | Whether disabled select | boolean | false | |
3333
| dropdownClassName | className of dropdown menu | string | - | |
34-
| dropdownMatchSelectWidth | Whether dropdown's width is same with select. | boolean | true | |
34+
| dropdownMatchSelectWidth | Determine whether the dropdown menu and the select input are the same width. Default set `min-width` same as input. Will ignore when value less than select width. `false` will disable virtual scroll | boolean \| number | true | |
3535
| dropdownRender | Customize dropdown content | ({menuNode: VNode, props}) => VNode \| v-slot | - | |
3636
| dropdownStyle | style of dropdown menu | object | - | |
3737
| dropdownMenuStyle | additional style applied to dropdown menu | object | - | |

components/select/index.zh-CN.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ cover: https://gw.alipayobjects.com/zos/alicdn/_0XzgOis7/Select.svg
3232
| defaultActiveFirstOption | 是否默认高亮第一个选项。 | boolean | true | |
3333
| disabled | 是否禁用 | boolean | false | |
3434
| dropdownClassName | 下拉菜单的 className 属性 | string | - | |
35-
| dropdownMatchSelectWidth | 下拉菜单和选择器同宽 | boolean | true | |
35+
| dropdownMatchSelectWidth | 下拉菜单和选择器同宽。默认将设置 `min-width`,当值小于选择框宽度时会被忽略。false 时会关闭虚拟滚动 | boolean \| number | true | |
3636
| dropdownRender | 自定义下拉框内容 | ({menuNode: VNode, props}) => VNode \| v-slot | - | |
3737
| dropdownStyle | 下拉菜单的 style 属性 | object | - | |
3838
| dropdownMenuStyle | dropdown 菜单自定义样式 | object | - | |

components/tree-select/index.en-US.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ Tree selection control.
1616
### Tree props
1717

1818
| Property | Description | Type | Default | Version |
19-
| --- | --- | --- | --- | --- |
19+
| --- | --- | --- | --- | --- | --- |
2020
| allowClear | Whether allow clear | boolean | false | |
2121
| defaultValue | To set the initial selected treeNode(s). | string\|string\[] | - | |
2222
| disabled | Disabled or not | boolean | false | |
2323
| dropdownClassName | className of dropdown menu | string | - | |
24-
| dropdownMatchSelectWidth | Determine whether the dropdown menu and the select input are the same width | boolean | true | |
24+
| dropdownMatchSelectWidth | Determine whether the dropdown menu and the select input are the same width. Default set `min-width` same as input. Will ignore when value less than select width. `false` will disable virtual scroll | boolean \| number | true | |
2525
| dropdownStyle | To set the style of the dropdown menu | object | - | |
2626
| filterTreeNode | Whether to filter treeNodes by input value. The value of `treeNodeFilterProp` is used for filtering by default. | boolean\|Function(inputValue: string, treeNode: TreeNode) (should return boolean) | Function | |
2727
| getPopupContainer | To set the container of the dropdown menu. The default is to create a `div` element in `body`, you can reset it to the scrolling area and make a relative reposition. | Function(triggerNode) | () => document.body | |

components/tree-select/index.zh-CN.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ cover: https://gw.alipayobjects.com/zos/alicdn/Ax4DA0njr/TreeSelect.svg
1717
### Tree props
1818

1919
| 参数 | 说明 | 类型 | 默认值 | 版本 |
20-
| --- | --- | --- | --- | --- |
20+
| --- | --- | --- | --- | --- | --- |
2121
| allowClear | 显示清除按钮 | boolean | false | |
2222
| defaultValue | 指定默认选中的条目 | string/string\[] | - | |
2323
| disabled | 是否禁用 | boolean | false | |
2424
| dropdownClassName | 下拉菜单的 className 属性 | string | - | |
25-
| dropdownMatchSelectWidth | 下拉菜单和选择器同宽 | boolean | true | |
25+
| dropdownMatchSelectWidth | 下拉菜单和选择器同宽。默认将设置 `min-width`,当值小于选择框宽度时会被忽略。false 时会关闭虚拟滚动 | boolean \| number | true | |
2626
| dropdownStyle | 下拉菜单的样式 | object | - | |
2727
| filterTreeNode | 是否根据输入项进行筛选,默认用 treeNodeFilterProp 的值作为要筛选的 TreeNode 的属性值 | boolean\|Function(inputValue: string, treeNode: TreeNode) (函数需要返回 bool 值) | Function | |
2828
| getPopupContainer | 菜单渲染父节点。默认渲染到 body 上,如果你遇到菜单滚动定位问题,试试修改为滚动的区域,并相对其定位。 | Function(triggerNode) | () => document.body | |

0 commit comments

Comments
 (0)