第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定

v-bind綁定的參數(shù)名不能用駝峰嗎?用了駝峰好像就不是<li>標(biāo)簽里的文本了,而是li標(biāo)簽里的一個(gè)屬性

<body>

<div id="root">

<ul>

<todo-item

v-for="it in lists"

v-bind:todoContent="it"

>

</todo-item>

</ul>

</div>

<script>

Vue.component('todo-item',{

props: ['todoContent'],

template: '<li>{{todoContent}}</li>'

})

new Vue({

el: "#root",

data: {

lists: ['123','123','423','1415']

},

methods: {

change: function() {

this.content = "hello change";

this.show = !this.show;

},

openli: function() {

this.subListOpen = !this.subListOpen;

?

}

}

})

</script>

</body>

https://img1.sycdn.imooc.com//5c80d8180001f51d09600234.jpg


正在回答

2 回答

是的,不能用大寫(xiě),也不能用‘-’連接

0 回復(fù) 有任何疑惑可以回復(fù)我~

剛剛看了下官方文檔,明白了:因?yàn)閔tml是不區(qū)分大小寫(xiě)的,v-bind:綁定的其實(shí)是todocontent,然而在組件里是js語(yǔ)法區(qū)分大小寫(xiě),參數(shù)名是todoContent,所以接收不到參數(shù)

https://img1.sycdn.imooc.com//5c80e0cc0001bc5b12070396.jpg

這樣就行了

1 回復(fù) 有任何疑惑可以回復(fù)我~

舉報(bào)

0/150
提交
取消

v-bind綁定的參數(shù)名不能用駝峰嗎?用了駝峰好像就不是<li>標(biāo)簽里的文本了,而是li標(biāo)簽里的一個(gè)屬性

我要回答 關(guān)注問(wèn)題
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)