functional: true,
props: {}, // 暂时没有需求需要,随着需求扩展可以在此定义通过html分割
render: (h, context) => {
const { children, slots } = context
const defaultSlot = slots.default ? slots.default() : []
const vNode = []
const validNode = children.filter((a) => a.tag !== undefined && a.tag !== null)
if (validNode.length > 0) {
for (let index = 0; index < validNode.length; index++) {
const ele = validNode[index]
vNode.push(ele)
if (index < validNode.length - 1) {
vNode.push(h('span', { class: ['sh_divide'] }))
}
}
}
vNode.push(...defaultSlot)
const container = h('div', { class: ['sh_space'] }, vNode)
return container
网友评论