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

為了賬號安全,請及時綁定郵箱和手機立即綁定

為什么可以在tabs組件里使用todo?

computed: {

? ?unFinishedTodoLength() {

? ? ?return this.todos.filter(todo => !todo.completed).length

? ?}

并沒有向tabs組件傳入todo,為什么可以使用

正在回答

2 回答

在父組件todo.vue中:

<tabs @toggle="toggleFilter"?

:filter="filter"??//在這里把filter傳給子組件tabs

:todos="todos"? //在這里把todos傳給子組件tabs

@clearAllCompleted="clearAllCompleted"

/>

在子組件todo.vue中:

props: {? ?//通過props這個屬性把父組件要傳過來的數(shù)據(jù)傳過來

????filter: {? ?//這個是父組件數(shù)據(jù)filter

????????type: String,? //定義filter傳過來的類型

????????required: true? //是否必須要filter這個數(shù)據(jù),true就是必須要

????},

????todos: {

????????type: Array,? //定義todos傳過來的類型

????????required: true

????}

},


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

歐先先生

第二個是在子組件tabs.vue中吧
2018-09-08 回復(fù) 有任何疑惑可以回復(fù)我~

父組件prop數(shù)據(jù)到子組件

<Tabs?
???:filter="filter"?
???:todos="todos"
???@toggle="toggleFilter"
???@clearAll="clearAllcompleted"
?/>


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

舉報

0/150
提交
取消

為什么可以在tabs組件里使用todo?

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

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

幫助反饋 APP下載

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

公眾號

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