N
N
Nik17122019-06-04 17:50:52
Vue.js
Nik1712, 2019-06-04 17:50:52

How to mount one application on vue in several places on one page?

There is an ordinary MVC site. The markup is given by the server. There are some repeating elements that are rewritten in vue so that we can hook data over the api and render it. Everything was fine as long as there was one entry point, conditional id="app", to which we mount our application through the render function. Production build, vue cli. Suddenly, it became necessary to render this component on the same page in different places and with different parameters, but between it there should be content returned by the server. In fact, this is one component that needs to be drawn several times, but between pieces of code that should remain.
Is it possible and how to implement it, in which direction to think, if we exclude the option where the server immediately gives the markup a la vue component and runtime + compiler assembly?
Or mount the application once, but be able to stuff inside what is being rendered, strictly following the sequence, part of the data that was output when rendering from the server?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question