-
-
Notifications
You must be signed in to change notification settings - Fork 33.8k
Closed
Description
Version
2.2.6
Reproduction link
https://jsbin.com/mugosexini/edit?html,css,js,output
Steps to reproduce
const child = {
name: "child",
render: function () {
console.log(this.$slots.default)
return 1
}
}
const parent = {
template: "<div>\
<child>\
<p>1</p>\
<p>2</p>\
</child>\
</div>",
components: {
child: child
}
}
the child component console the $slots.default
is a vnodes list which length is 3.
It also reproduce when I wrote parent
template in <template>
element
What is expected?
this.$slots.default
DO NOT INCLUDE empty vnodes
What is actually happening?
this.$slots.default include a empty vnode between two <p>
element
this.$slots.default seems different from React's this.props.children...
Metadata
Metadata
Assignees
Labels
No labels