Skip to content

Commit 100cff2

Browse files
authored
feat: table support for v-clicks (#1202)
1 parent 9ea85b1 commit 100cff2

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

packages/client/builtin/VClicks.ts

+18
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,24 @@ export default defineComponent({
118118
if (defaults.length === 1 && listTags.includes(defaults[0].type as string) && Array.isArray(defaults[0].children))
119119
return h(defaults[0], {}, [mapChildren(defaults[0].children)[0]])
120120

121+
if (defaults.length === 1 && defaults[0].type as string === 'table') {
122+
const tableNode = defaults[0]
123+
if (Array.isArray(tableNode.children)) {
124+
return h(tableNode, {}, tableNode.children.map((i) => {
125+
if (!isVNode(i)) {
126+
return i
127+
}
128+
else {
129+
if (i.type === 'tbody' && Array.isArray(i.children))
130+
return h(i, {}, [mapChildren(i.children)[0]])
131+
132+
else
133+
return h(i)
134+
}
135+
}))
136+
}
137+
}
138+
121139
return mapChildren(defaults)[0]
122140
},
123141
})

0 commit comments

Comments
 (0)