直接用todo-item中l(wèi)i標(biāo)簽的key為什么不行啊,老師
todo-item中l(wèi)i標(biāo)簽的key已經(jīng)綁定賦值了index,但是為什么,我在li標(biāo)簽的點(diǎn)擊事件里獲取索引值是undefined
todo-item中l(wèi)i標(biāo)簽的key已經(jīng)綁定賦值了index,但是為什么,我在li標(biāo)簽的點(diǎn)擊事件里獲取索引值是undefined
2018-10-26
舉報(bào)
2019-04-03
你使用的時(shí)候,網(wǎng)頁就已經(jīng)報(bào)錯了
報(bào)錯信息:
[Vue warn]: "key" is a reserved attribute and cannot be used as component prop.
key是個保留字,不能用于組件屬性
2018-10-27
點(diǎn)擊的時(shí)候用到的 是 index , 而不是 key, 所以 要另外 綁定 :index="index"