Skip to content

Commit 687f966

Browse files
authored
fix(Space): fixed template white space bugs (#3401)
* fix(TimePicker): fixed only support hh:mm format * fix(TimePicker): disabled position only is start * fix(Upload): fixed vue error on uploadPastedFiles is false * docs: add readonly in api * fix: fixed template white space bugs * chore: update snap
1 parent 7ac83c7 commit 687f966

File tree

4 files changed

+36
-7
lines changed

4 files changed

+36
-7
lines changed

src/select/hooks/useSelectOptions.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,10 @@ export default function useSelectOptions(
6565
// 处理 slots 中 t-option 与 t-option-group
6666
const currentSlots = instance.proxy.$slots.default || [];
6767
currentSlots.forEach((child) => {
68+
if (!child.componentOptions) {
69+
return;
70+
}
71+
6872
const componentName = getVNodeComponentName(child);
6973
if (componentName && componentName === getVueComponentName(Option)) {
7074
// 独立选项

src/space/space.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,13 @@ export default defineComponent({
6767

6868
render() {
6969
const { COMPONENT_NAME, spaceClassNames, renderStyle } = this;
70-
const children = this.$slots.default?.filter((child) => child.tag !== undefined || child.text) || [];
70+
const children = this.$slots.default || [];
7171
const childCount = children?.length;
7272
const renderChildren = () => children.map((child, index) => {
73+
if (!child.tag && !child.text) {
74+
return child;
75+
}
76+
7377
const separatorNode = renderTNodeJSX(this, 'separator');
7478
const showSeparator = index + 1 !== childCount && separatorNode;
7579
return [

test/snap/__snapshots__/csr.test.js.snap

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70964,6 +70964,7 @@ exports[`csr snapshot test > csr test ./src/loading/_example/delay.vue 1`] = `
7096470964
</svg>
7096570965
</div>
7096670966
</div>
70967+
<!---->
7096770968
</div>
7096870969
</div>
7096970970
<div
@@ -77528,6 +77529,7 @@ exports[`csr snapshot test > csr test ./src/notification/_example/base.vue 1`] =
7752877529
</div>
7752977530
</div>
7753077531
</div>
77532+
<!---->
7753177533
</div>
7753277534
`;
7753377535

@@ -113447,6 +113449,7 @@ exports[`csr snapshot test > csr test ./src/tooltip/_example/duration.vue 1`] =
113447113449
</span>
113448113450
</button>
113449113451
</div>
113452+
<!---->
113450113453
</div>
113451113454
`;
113452113455

@@ -123824,6 +123827,7 @@ exports[`csr snapshot test > csr test ./src/tree/_example/disabled.vue 1`] = `
123824123827
class="t-space t-space-horizontal"
123825123828
style="gap: 10px;"
123826123829
>
123830+
<!---->
123827123831
<div
123828123832
class="t-space-item"
123829123833
>
@@ -123910,6 +123914,7 @@ exports[`csr snapshot test > csr test ./src/tree/_example/disabled.vue 1`] = `
123910123914
</span>
123911123915
</button>
123912123916
</div>
123917+
<!---->
123913123918
</div>
123914123919
</span>
123915123920
</div>
@@ -123969,6 +123974,7 @@ exports[`csr snapshot test > csr test ./src/tree/_example/disabled.vue 1`] = `
123969123974
</span>
123970123975
</button>
123971123976
</div>
123977+
<!---->
123972123978
</div>
123973123979
</span>
123974123980
</div>
@@ -124028,6 +124034,7 @@ exports[`csr snapshot test > csr test ./src/tree/_example/disabled.vue 1`] = `
124028124034
</span>
124029124035
</button>
124030124036
</div>
124037+
<!---->
124031124038
</div>
124032124039
</span>
124033124040
</div>
@@ -124085,6 +124092,7 @@ exports[`csr snapshot test > csr test ./src/tree/_example/disabled.vue 1`] = `
124085124092
class="t-space t-space-horizontal"
124086124093
style="gap: 10px;"
124087124094
>
124095+
<!---->
124088124096
<div
124089124097
class="t-space-item"
124090124098
>
@@ -124143,6 +124151,7 @@ exports[`csr snapshot test > csr test ./src/tree/_example/disabled.vue 1`] = `
124143124151
class="t-space t-space-horizontal"
124144124152
style="gap: 10px;"
124145124153
>
124154+
<!---->
124146124155
<div
124147124156
class="t-space-item"
124148124157
>
@@ -124201,6 +124210,7 @@ exports[`csr snapshot test > csr test ./src/tree/_example/disabled.vue 1`] = `
124201124210
class="t-space t-space-horizontal"
124202124211
style="gap: 10px;"
124203124212
>
124213+
<!---->
124204124214
<div
124205124215
class="t-space-item"
124206124216
>
@@ -124272,6 +124282,7 @@ exports[`csr snapshot test > csr test ./src/tree/_example/disabled.vue 1`] = `
124272124282
class="t-space t-space-horizontal"
124273124283
style="gap: 10px;"
124274124284
>
124285+
<!---->
124275124286
<div
124276124287
class="t-space-item"
124277124288
>
@@ -124358,6 +124369,7 @@ exports[`csr snapshot test > csr test ./src/tree/_example/disabled.vue 1`] = `
124358124369
</span>
124359124370
</button>
124360124371
</div>
124372+
<!---->
124361124373
</div>
124362124374
</span>
124363124375
</div>
@@ -124417,6 +124429,7 @@ exports[`csr snapshot test > csr test ./src/tree/_example/disabled.vue 1`] = `
124417124429
</span>
124418124430
</button>
124419124431
</div>
124432+
<!---->
124420124433
</div>
124421124434
</span>
124422124435
</div>
@@ -124476,6 +124489,7 @@ exports[`csr snapshot test > csr test ./src/tree/_example/disabled.vue 1`] = `
124476124489
</span>
124477124490
</button>
124478124491
</div>
124492+
<!---->
124479124493
</div>
124480124494
</span>
124481124495
</div>
@@ -124533,6 +124547,7 @@ exports[`csr snapshot test > csr test ./src/tree/_example/disabled.vue 1`] = `
124533124547
class="t-space t-space-horizontal"
124534124548
style="gap: 10px;"
124535124549
>
124550+
<!---->
124536124551
<div
124537124552
class="t-space-item"
124538124553
>
@@ -124591,6 +124606,7 @@ exports[`csr snapshot test > csr test ./src/tree/_example/disabled.vue 1`] = `
124591124606
class="t-space t-space-horizontal"
124592124607
style="gap: 10px;"
124593124608
>
124609+
<!---->
124594124610
<div
124595124611
class="t-space-item"
124596124612
>
@@ -124649,6 +124665,7 @@ exports[`csr snapshot test > csr test ./src/tree/_example/disabled.vue 1`] = `
124649124665
class="t-space t-space-horizontal"
124650124666
style="gap: 10px;"
124651124667
>
124668+
<!---->
124652124669
<div
124653124670
class="t-space-item"
124654124671
>
@@ -135655,6 +135672,8 @@ exports[`csr snapshot test > csr test ./src/upload/_example/base.vue 1`] = `
135655135672
</span>
135656135673
</label>
135657135674
</div>
135675+
<!---->
135676+
<!---->
135658135677
<div
135659135678
class="t-space-item"
135660135679
>
@@ -135678,6 +135697,7 @@ exports[`csr snapshot test > csr test ./src/upload/_example/base.vue 1`] = `
135678135697
</span>
135679135698
</label>
135680135699
</div>
135700+
<!---->
135681135701
</div>
135682135702
</div>
135683135703
<div
@@ -136475,6 +136495,7 @@ exports[`csr snapshot test > csr test ./src/upload/_example/image.vue 1`] = `
136475136495
</span>
136476136496
</label>
136477136497
</div>
136498+
<!---->
136478136499
</div>
136479136500
</div>
136480136501
<div

0 commit comments

Comments
 (0)