Answer the question
In order to leave comments, you need to log in
Vue component. How to submit a template?
Good afternoon.
I'm trying to rewrite my app from vue 2 to vue-next. The problem is the following, earlier I could prescribe component templates in the template, that is, of the form
<div id="appAuth">
<router-view></router-view>
<script type="text/x-template" id="my-component">html form</script>
<script type="text/x-template" id="my2-component">html form 2</script>
</div>
const my = Vue.component('my-component', {
template: '#my-component',
...
const my2 = Vue.component('my2-component', {
template: '#my2-component',
Answer the question
In order to leave comments, you need to log in
with minimal changes - immediately insert an HTML string into the template property:
const my = Vue.component('my-component', {
template: `
html
form
`,
(note these are not single quotes, but backticks)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question