Skip to content

Commit 58f6d6e

Browse files
committed
Merge remote-tracking branch 'origin/main' into feat-v4
2 parents 7270855 + 8212237 commit 58f6d6e

16 files changed

+143
-68
lines changed

README.md

+2
Original file line numberDiff line numberDiff line change
@@ -86,3 +86,5 @@ Become a sponsor and get your logo on our README on Github with a link to your s
8686
## [More Sponsor (From Patreon、alipay、wechat、paypal...)](https://github.com/vueComponent/ant-design-vue/blob/master/BACKERS.md)
8787

8888
[![Let's fund issues in this repository](https://issuehunt.io/static/embed/issuehunt-button-v1.svg)](https://issuehunt.io/repos/104172832)
89+
90+
This project is tested with BrowserStack.

components/image/PreviewGroup.tsx

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import type { PreviewGroupPreview } from '../vc-image/src/PreviewGroup';
22
import PreviewGroup from '../vc-image/src/PreviewGroup';
3+
import type { ExtractPropTypes } from 'vue';
34
import { computed, defineComponent } from 'vue';
45
import useConfigInject from '../config-provider/hooks/useConfigInject';
56

@@ -22,12 +23,17 @@ export const icons = {
2223
left: <LeftOutlined />,
2324
right: <RightOutlined />,
2425
};
26+
const previewGroupProps = () => ({
27+
previewPrefixCls: String,
28+
preview: anyType<boolean | PreviewGroupPreview>(),
29+
});
30+
export type ImageGroupProps = Partial<ExtractPropTypes<ReturnType<typeof previewGroupProps>>>;
2531

2632
const InternalPreviewGroup = defineComponent({
2733
compatConfig: { MODE: 3 },
2834
name: 'AImagePreviewGroup',
2935
inheritAttrs: false,
30-
props: { previewPrefixCls: String, preview: anyType<boolean | PreviewGroupPreview>() },
36+
props: previewGroupProps(),
3137
setup(props, { attrs, slots }) {
3238
const { prefixCls } = useConfigInject('image', props);
3339
const previewPrefixCls = computed(() => `${prefixCls.value}-preview`);

components/tree-select/demo/basic.vue

+21-10
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,11 @@ The most basic usage.
2626
allow-clear
2727
tree-default-expand-all
2828
:tree-data="treeData"
29+
tree-node-filter-prop="label"
2930
>
30-
<template #title="{ value: val, title }">
31+
<template #title="{ value: val, label }">
3132
<b v-if="val === 'parent 1-1'" style="color: #08c">sss</b>
32-
<template v-else>{{ title }}</template>
33+
<template v-else>{{ label }}</template>
3334
</template>
3435
</a-tree-select>
3536
</template>
@@ -39,25 +40,35 @@ import type { TreeSelectProps } from 'ant-design-vue';
3940
const value = ref<string>();
4041
const treeData = ref<TreeSelectProps['treeData']>([
4142
{
42-
title: 'parent 1',
43+
label: 'parent 1',
4344
value: 'parent 1',
4445
children: [
4546
{
46-
title: 'parent 1-0',
47-
value: 'parent 1-0',
47+
label: 'parent 1',
48+
value: 'parent 1',
4849
children: [
4950
{
50-
title: 'my leaf',
51-
value: 'leaf1',
51+
label: 'parent 1-0',
52+
value: 'parent 1-0',
53+
children: [
54+
{
55+
label: 'my leaf',
56+
value: 'leaf1',
57+
},
58+
{
59+
label: 'your leaf',
60+
value: 'leaf2',
61+
},
62+
],
5263
},
5364
{
54-
title: 'your leaf',
55-
value: 'leaf2',
65+
label: 'parent 1-1',
66+
value: 'parent 1-1',
5667
},
5768
],
5869
},
5970
{
60-
title: 'parent 1-1',
71+
label: 'parent 1-1',
6172
value: 'parent 1-1',
6273
},
6374
],

components/tree-select/demo/checkable.vue

+7-6
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ Multiple and checkable.
2424
allow-clear
2525
:show-checked-strategy="SHOW_PARENT"
2626
placeholder="Please select"
27+
tree-node-filter-prop="label"
2728
/>
2829
</template>
2930
<script lang="ts" setup>
@@ -34,31 +35,31 @@ const SHOW_PARENT = TreeSelect.SHOW_PARENT;
3435
3536
const treeData: TreeSelectProps['treeData'] = [
3637
{
37-
title: 'Node1',
38+
label: 'Node1',
3839
value: '0-0',
3940
children: [
4041
{
41-
title: 'Child Node1',
42+
label: 'Child Node1',
4243
value: '0-0-0',
4344
},
4445
],
4546
},
4647
{
47-
title: 'Node2',
48+
label: 'Node2',
4849
value: '0-1',
4950
5051
children: [
5152
{
52-
title: 'Child Node3',
53+
label: 'Child Node3',
5354
value: '0-1-0',
5455
disabled: true,
5556
},
5657
{
57-
title: 'Child Node4',
58+
label: 'Child Node4',
5859
value: '0-1-1',
5960
},
6061
{
61-
title: 'Child Node5',
62+
label: 'Child Node5',
6263
value: '0-1-2',
6364
},
6465
],

components/tree-select/demo/custom-tag-render.vue

+26-13
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,16 @@ Allows for custom rendering of tags.
2828
:show-checked-strategy="SHOW_ALL"
2929
tree-default-expand-all
3030
:tree-data="treeData"
31+
tree-node-filter-prop="label"
3132
>
3233
<template #tagRender="{ label, closable, onClose, option }">
3334
<a-tag :closable="closable" :color="option.color" style="margin-right: 3px" @close="onClose">
3435
{{ label }}&nbsp;&nbsp;
3536
</a-tag>
3637
</template>
37-
<template #title="{ value: val, title }">
38+
<template #title="{ value: val, label }">
3839
<b v-if="val === 'parent 1-1'" style="color: #08c">{{ val }}</b>
39-
<template v-else>{{ title }}</template>
40+
<template v-else>{{ label }}</template>
4041
</template>
4142
</a-tree-select>
4243
</template>
@@ -48,29 +49,41 @@ const SHOW_ALL = TreeSelect.SHOW_ALL;
4849
const value = ref<string[]>(['parent 1', 'parent 1-0', 'leaf1']);
4950
const treeData = ref<TreeSelectProps['treeData']>([
5051
{
51-
title: 'parent 1',
52+
label: 'parent 1',
5253
value: 'parent 1',
5354
color: 'pink',
5455
children: [
5556
{
56-
title: 'parent 1-0',
57-
value: 'parent 1-0',
58-
color: 'orange',
57+
label: 'parent 1',
58+
value: 'parent 1',
59+
color: 'pink',
5960
children: [
6061
{
61-
title: 'my leaf',
62-
value: 'leaf1',
63-
color: 'green',
62+
label: 'parent 1-0',
63+
value: 'parent 1-0',
64+
color: 'orange',
65+
children: [
66+
{
67+
label: 'my leaf',
68+
value: 'leaf1',
69+
color: 'green',
70+
},
71+
{
72+
label: 'your leaf',
73+
value: 'leaf2',
74+
color: 'cyan',
75+
},
76+
],
6477
},
6578
{
66-
title: 'your leaf',
67-
value: 'leaf2',
68-
color: 'cyan',
79+
label: 'parent 1-1',
80+
value: 'parent 1-1',
81+
color: 'blue',
6982
},
7083
],
7184
},
7285
{
73-
title: 'parent 1-1',
86+
label: 'parent 1-1',
7487
value: 'parent 1-1',
7588
color: 'blue',
7689
},

components/tree-select/demo/highlight.vue

+21-10
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,13 @@ Search Value Hightlight
2727
allow-clear
2828
tree-default-expand-all
2929
:tree-data="treeData"
30+
tree-node-filter-prop="label"
3031
>
31-
<template #title="{ value: val, title }">
32+
<template #title="{ value: val, label }">
3233
<b v-if="val === 'parent 1-1'" style="color: #08c">sss</b>
3334
<template v-else>
3435
<template
35-
v-for="(fragment, i) in title
36+
v-for="(fragment, i) in label
3637
.toString()
3738
.split(new RegExp(`(?<=${searchValue})|(?=${searchValue})`, 'i'))"
3839
>
@@ -55,25 +56,35 @@ import { ref, watch } from 'vue';
5556
const value = ref<string>();
5657
const treeData = ref<TreeSelectProps['treeData']>([
5758
{
58-
title: 'parent 1',
59+
label: 'parent 1',
5960
value: 'parent 1',
6061
children: [
6162
{
62-
title: 'parent 1-0',
63-
value: 'parent 1-0',
63+
label: 'parent 1',
64+
value: 'parent 1',
6465
children: [
6566
{
66-
title: 'my leaf',
67-
value: 'leaf1',
67+
label: 'parent 1-0',
68+
value: 'parent 1-0',
69+
children: [
70+
{
71+
label: 'my leaf',
72+
value: 'leaf1',
73+
},
74+
{
75+
label: 'your leaf',
76+
value: 'leaf2',
77+
},
78+
],
6879
},
6980
{
70-
title: 'your leaf',
71-
value: 'leaf2',
81+
label: 'parent 1-1',
82+
value: 'parent 1-1',
7283
},
7384
],
7485
},
7586
{
76-
title: 'parent 1-1',
87+
label: 'parent 1-1',
7788
value: 'parent 1-1',
7889
},
7990
],

components/tree-select/demo/multiple.vue

+21-10
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,11 @@ Multiple selection usage.
2727
multiple
2828
tree-default-expand-all
2929
:tree-data="treeData"
30+
tree-node-filter-prop="label"
3031
>
31-
<template #title="{ value: val, title }">
32+
<template #title="{ value: val, label }">
3233
<b v-if="val === 'parent 1-1'" style="color: #08c">{{ val }}</b>
33-
<template v-else>{{ title }}</template>
34+
<template v-else>{{ label }}</template>
3435
</template>
3536
</a-tree-select>
3637
</template>
@@ -41,25 +42,35 @@ import type { TreeSelectProps } from 'ant-design-vue';
4142
const value = ref<string[]>([]);
4243
const treeData = ref<TreeSelectProps['treeData']>([
4344
{
44-
title: 'parent 1',
45+
label: 'parent 1',
4546
value: 'parent 1',
4647
children: [
4748
{
48-
title: 'parent 1-0',
49-
value: 'parent 1-0',
49+
label: 'parent 1',
50+
value: 'parent 1',
5051
children: [
5152
{
52-
title: 'my leaf',
53-
value: 'leaf1',
53+
label: 'parent 1-0',
54+
value: 'parent 1-0',
55+
children: [
56+
{
57+
label: 'my leaf',
58+
value: 'leaf1',
59+
},
60+
{
61+
label: 'your leaf',
62+
value: 'leaf2',
63+
},
64+
],
5465
},
5566
{
56-
title: 'your leaf',
57-
value: 'leaf2',
67+
label: 'parent 1-1',
68+
value: 'parent 1-1',
5869
},
5970
],
6071
},
6172
{
62-
title: 'parent 1-1',
73+
label: 'parent 1-1',
6374
value: 'parent 1-1',
6475
},
6576
],

components/tree-select/demo/placement.vue

+6-5
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ You can manually specify the position of the popup via `placement`.
3535
:tree-data="treeData"
3636
:placement="placement"
3737
:dropdown-match-select-width="false"
38+
tree-node-filter-prop="label"
3839
>
3940
<template #title="{ value: val, title }">
4041
<b v-if="val === 'parent 1-1'" style="color: #08c">sss</b>
@@ -49,25 +50,25 @@ const placement = ref('topLeft' as const);
4950
const value = ref<string>();
5051
const treeData = ref<TreeSelectProps['treeData']>([
5152
{
52-
title: 'parent 1',
53+
label: 'parent 1',
5354
value: 'parent 1',
5455
children: [
5556
{
56-
title: 'parent 1-0',
57+
label: 'parent 1-0',
5758
value: 'parent 1-0',
5859
children: [
5960
{
60-
title: 'my leaf',
61+
label: 'my leaf',
6162
value: 'leaf1',
6263
},
6364
{
64-
title: 'your leaf',
65+
label: 'your leaf',
6566
value: 'leaf2',
6667
},
6768
],
6869
},
6970
{
70-
title: 'parent 1-1',
71+
label: 'parent 1-1',
7172
value: 'parent 1-1',
7273
},
7374
],

components/tree-select/demo/replaceFields.vue

+1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ Replace the title,key and children fields in treeNode with the corresponding fie
3131
label: 'name',
3232
value: 'value',
3333
}"
34+
tree-node-filter-prop="name"
3435
></a-tree-select>
3536
</template>
3637
<script lang="ts" setup>

components/tree-select/demo/suffix.vue

+12
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,12 @@ The most basic usage.
2727
allow-clear
2828
tree-default-expand-all
2929
:tree-data="treeData"
30+
:field-names="{
31+
children: 'children',
32+
value: 'value',
33+
label: 'title',
34+
}"
35+
tree-node-filter-prop="title"
3036
>
3137
<template #suffixIcon><SmileOutlined /></template>
3238
</a-tree-select>
@@ -42,6 +48,12 @@ The most basic usage.
4248
show-arrow
4349
tree-default-expand-all
4450
:tree-data="treeData"
51+
:field-names="{
52+
children: 'children',
53+
value: 'value',
54+
label: 'title',
55+
}"
56+
tree-node-filter-prop="title"
4557
>
4658
<template #suffixIcon><SmileOutlined /></template>
4759
</a-tree-select>

0 commit comments

Comments
 (0)