Data Variable
var data = {
template:`<div class="box-word-cent">
<h2>{{ title }}</h2>
<p>{{ desc }}</p>
</div>`,
content:{
title:'This is Title',
desc:'This is. Description'
}
}
Vue
var vm = new Vue({
el:'#app',
data: data
});
Html
<div id="app">
<div v-html="data.template"></div>
</div>
I try to separate content data from template, but it seems like not work.
any one can help to achieve this conception ?
v-html