課程
/前端開發(fā)
/Vue.js
/vue.js入門基礎(chǔ)
我的一直報(bào)錯(cuò)Property or method "newItem" is not defined on the instance but referenced during render
2018-08-17
源自:vue.js入門基礎(chǔ) 2-2
正在回答
在data里面先定義一個(gè)newItem:''? ?
data:function(){
? ? return{
? ? ? title:'this is a todo list',
? ? ? items:[
? ? ? ? {
? ? ? ? ? label:'coding',
? ? ? ? ? isFinshed:true
? ? ? ? },
? ? ? ? ? label:'walking',
? ? ? ? }
? ? ? ],
? ? ? newItem:''
? ? }
?}
小花菜6
定義了實(shí)例屬性item后,? ?找到v-model的方法? 每次執(zhí)行完加上this.item = "";就好了?
報(bào)錯(cuò)信息都告訴你了,沒(méi)有定義實(shí)例屬性item。直白點(diǎn)講,就是你new Vue(option)時(shí)的參數(shù)對(duì)象 option.data內(nèi)沒(méi)有綁定實(shí)例屬性item,你綁定的是data!
舉報(bào)
本門為vuejs入門教程,詳細(xì)的講解加實(shí)戰(zhàn),可以幫你進(jìn)入vuejs的大門
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號(hào)-11 京公網(wǎng)安備11010802030151號(hào)
購(gòu)課補(bǔ)貼聯(lián)系客服咨詢優(yōu)惠詳情
慕課網(wǎng)APP您的移動(dòng)學(xué)習(xí)伙伴
掃描二維碼關(guān)注慕課網(wǎng)微信公眾號(hào)
2018-09-17
在data里面先定義一個(gè)newItem:''? ?
data:function(){
? ? return{
? ? ? title:'this is a todo list',
? ? ? items:[
? ? ? ? {
? ? ? ? ? label:'coding',
? ? ? ? ? isFinshed:true
? ? ? ? },
? ? ? ? {
? ? ? ? ? label:'walking',
? ? ? ? ? isFinshed:true
? ? ? ? }
? ? ? ],
? ? ? newItem:''
? ? }
?}
2018-08-29
定義了實(shí)例屬性item后,? ?找到v-model的方法? 每次執(zhí)行完加上this.item = "";就好了?
2018-08-20
報(bào)錯(cuò)信息都告訴你了,沒(méi)有定義實(shí)例屬性item。直白點(diǎn)講,就是你new Vue(option)時(shí)的參數(shù)對(duì)象 option.data內(nèi)沒(méi)有綁定實(shí)例屬性item,你綁定的是data!