0
var data=new Vue({
el:"body",
data:{
user:{
name:"tom",
nickname:"tom1"
}
}
});
我可以在html中使用這種方式嗎?vuejs,v-model derective可以綁定json
<input type="text" v-model="user.name"/>
<input type="text" v-model="user.nickname"/>
我遇到這樣的故障,控制檯
vue.min.js:6 TypeError: Cannot read property 'name' of undefined(…)
我用同樣的這種方式https://jsfiddle.net/5y5dvucv/ ..它的上jsfinddle工作,但不是在我的計劃 –
檢查VUE js版,你進口在你的程序中 – Sujithrao