Answer the question
In order to leave comments, you need to log in
Vue.js HTML rendering with Vue tag?
Hello.
Task:
- Render the HTML template received from the API with Vue tags.
To do this, I use an asynchronous component in which I throw a 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)
})
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question