Skip to content

Commit 7b3a338

Browse files
committed
Merge remote-tracking branch 'origin/dev'
2 parents 25f9fdc + d2007f3 commit 7b3a338

2 files changed

Lines changed: 19 additions & 15 deletions

File tree

src/components/FormLayout/FormLayout.vue

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ div(:class="styles.FormLayout")
2323

2424
<script setup lang="ts">
2525
import { computed, onBeforeUpdate, onMounted, ref, useSlots } from 'vue';
26+
import type { VNodeArrayChildren } from 'vue';
2627
import styles from '@/classes/FormLayout.json';
2728
import { Item } from './components';
2829
@@ -33,21 +34,24 @@ const itemGroupIndexes = ref<boolean[]>([]);
3334
const slots = useSlots();
3435
3536
const slotsElms = computed(() => {
36-
const elms: any[] = [];
37-
const defaultSlot = slots.default && slots.default();
37+
const items : VNodeArrayChildren = [];
38+
if (slots.default) {
39+
slots.default().map(item => {
40+
const children = item.children as VNodeArrayChildren;
41+
if (typeof children === 'string' && children === 'v-if') {
42+
return;
43+
}
3844
39-
// Nothing in the default slot
40-
if (!defaultSlot || !defaultSlot.length) { return elms; }
41-
42-
for (let i = 0; i < defaultSlot.length; i++) {
43-
if (defaultSlot[i].type.toString() === 'Symbol()') {
44-
elms.push(defaultSlot[i].children);
45-
} else {
46-
elms.push(defaultSlot[i]);
47-
}
45+
if (item.type.toString() === 'Symbol(Fragment)') {
46+
children.forEach(child => {
47+
items.push(child);
48+
});
49+
} else {
50+
items.push(item);
51+
}
52+
});
4853
}
49-
50-
return elms;
54+
return items;
5155
});
5256
5357
onBeforeUpdate(() => {

src/components/TextField/README.stories.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -727,7 +727,7 @@ Use when input text should be aligned right.
727727
export const RightAlignedField = (args, { argTypes }) => ({
728728
components: { TextField, Stack, StackItem },
729729
template: `
730-
<Stack>
730+
<Stack alignment="center">
731731
<StackItem :fill="true">
732732
Price
733733
</StackItem>
@@ -753,7 +753,7 @@ RightAlignedField.parameters = {
753753
source: {
754754
state: 'close',
755755
code: dedent`
756-
<Stack>
756+
<Stack alignment="center">
757757
<StackItem :fill="true">
758758
Price
759759
</StackItem>

0 commit comments

Comments
 (0)