I have the following code generated by my server :
<div id="app-4" data-server-rendered="true">
<ul>
<li>Article 1 test1</li>
<li>Article 2 test2</li>
</ul>
</div>
Now with Vue.js, I would like to generate again this code if data changes. Is that possible ?
I tried to do something but it doesn't work :
var app4 = new Vue({
el: '#app-4',
props: ["todo"],
template: ' <ul>\n' +
' <li v-for="todo in todos">\n' +
' {{ todo.title }} {{ todo.text }}' +
' </li>\n' +
' </ul>',
data: {
todos: [
{ title: 'Article 3', text:"test1" },
{ title: 'Article 4', text:"test2" },
{ title: 'Article 5', text:"test3" }
]
}
})
Theoritically, as I put a data.todos value which is not the same than in output generated by the server, it should change. But it stays with my 2 li. If I remove data-server-rendered="true", it will display my 3 li.
propson that.