1. In all component trees, if VNode is a component or a slot, that contains components, then VNode must be unique. So the following two examples are wrong. how to understand this
first error Chestnut:
<div id="app">
<ele>
<div>
<Child></Child>
</div>
</ele>
<div>
Vue.component("Child", {
render: function (createElement) {
return createElement("p", "text");
}
});
Vue.component("ele", {
render: function (createElement) {
var ChildNode = createElement(Child);
return createElement("div", [
this.$slots.default,
this.$slots.default
])
}
})
these two chestnuts say they expect to render two Child components, that is, two
text
nodes, but actually render only one, because VNode is constrained.but I"ve tried to render two nodes, that is,
text
, and I don"t know what one of them says .