J
J
Jan2019-09-18 09:51:55
Vue.js
Jan, 2019-09-18 09:51:55

How to export template from .vue file to index.html?

Good afternoon, dear developers!
The question is strange, but it has its place.
The situation is such that I want to use vue-cli, do everything in a new-fruity way, but that's bad luck, the specifics of the project are such that you need to have access to the layout for the build version, i.e. so that the layout from the template in the .vue component files is "magically" exported to index.html, and not actually stored in js files after the build.
Is there such an option for the implementation of the project? Or perhaps someone will tell you a variant of the collector for such "magic".
Probably I don’t understand something, I would like to hear the advice of the esteemed public of the Toaster.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey delphinpro, 2019-09-18
@Yancheg

Server Side Rendering (SSR) - you will run your bundle in a node environment and it will spit out the finished filled html markup.
The second option is Prerender during assembly (prerender spa). The build will render finished pages. This option is suitable for static sites.
In both cases, you do not need to go into the generated html.
But I feel like you need something else. Explain more precisely.
Perhaps you don't need to make the entire page a view appliqué. Sometimes it is enough to make separate blocks / widgets on it.
Another option is to make the whole page under the view, connect the full assembly of the framework (including the runtime compiler).
Then, in theory, you can form the page by other means (php) and use your components in it.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question