Vue.js the HTML rendering with Vue-tag?

Hello.

Task :
- Render HTML template received from the API with Vue-tags.

To use an asynchronous component in which the casting parameter
Vue.component('HeaderBase', function (resolve, reject) {
 setTimeout(function () {
resolve({
 template: '<div>{{ posts.html }}</div>',
 data: () => ({
 temp: {
 html: '<div></div>',
 name: "Hello World "
},
}),
 created () {
axios.get('http://.../test/1/')
 .then(response => {
 this.temp = response.data
})
}
})
 }, 1000)
})


temp.html = {{ temp.name }}
Of course as a result I get a simple string with tags. I decided to try using v-html , but {{ temp.name }} has left the string.

The result I expect is : Hello World

Please help because Google is already quite a lot.
June 8th 19 at 16:34
1 answer
June 8th 19 at 16:36
Solution
You can use Vue.compile to compile the template, and define your own render function, which will use the result of compilation. Somehow so.
Thank you, exactly what you want) - elouise.Haag commented on June 8th 19 at 16:39

Find more questions by tags Vue.js