Answer the question
In order to leave comments, you need to log in
Why does Vue only render the first element?
I don't understand what's going on, but for some reason Vue only renders the first element. Let's say this is the code:
<div id="app">
<app/>
<designer ref="designer"/>
<higlighter ref="higlighter"/>
<context-menu ref="context_menu"/>
</div>
const app = new Vue({
el: '#app',
components: { App, Designer, Higlighter, ContextMenu}
});
Answer the question
In order to leave comments, you need to log in
Because in html, not every tag can be self-closing, and if it can’t, and you designed it that way, then it is considered by the browser as opening, and everything that follows it gets inside the element. That is, your app element has a designer child element, it also has a higlighter child element, which has a context-menu inside. In this form, your template gets to Vue.
So close the tags, or use something else instead of a dom template - a template property, a render function, single-file components.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question