插槽赋值

// instance 为 vue实例     footer为vnode  
   
if (isVNode(instance.footer)) {
   instance.$slots.footer = [instance.footer]
   instance.footer = null
} else {
   delete instance.$slots.footer
}

vnode创建

const h = this.$createElement;
 
 h('div', null, [
    h('Button', {
        props: {
            type: "error"
        }
    }, '这是错误按钮')
]),
最后修改:2023 年 03 月 06 日
如果觉得我的文章对你有用,请随意赞赏