Answer the question
In order to leave comments, you need to log in
How to use 2 VUE components on one page?
I am learning Laravel + Vue. You need to place 2 vue components in one Laravel blade template. I know that you can create another id="app2", but somehow it looks ugly :) I need only one component and for this I don't want to make another id in the global app.js. Is there another way to make them work? In theory, no .. But maybe some kind of Laravel trick?
UPDATE
So far, I have found an option - to close access in the template for the second component on conflicting pages.
@if (!(Request::is('signup') || Request::is('login')))
<span id="app">
<auth></auth>
</span>
@endif
Answer the question
In order to leave comments, you need to log in
And what's the problem? You need two vue instances - call the initialization of the root component twice with the required element id, if you don’t want to render to different elements with different ids, write another level of abstraction so that these two instances are inside the same application and render them in the same application as two neighboring ones component
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question