vue-prop父組件向子組件進(jìn)行傳值的方法
來(lái)源:懂視網(wǎng)
責(zé)編:小采
時(shí)間:2020-11-27 22:18:29
vue-prop父組件向子組件進(jìn)行傳值的方法
vue-prop父組件向子組件進(jìn)行傳值的方法:vue-prop是父組件向子組件進(jìn)行傳遞數(shù)據(jù)時(shí)使用的。 例如子組件為 child.vue template: '<div>msg: {{msg}}</div>' props: ['msg'], 我們?cè)谧咏M件里規(guī)定了一個(gè)數(shù)據(jù)名字叫msg 父組件里面寫(xiě) <child msg=hello, v
導(dǎo)讀vue-prop父組件向子組件進(jìn)行傳值的方法:vue-prop是父組件向子組件進(jìn)行傳遞數(shù)據(jù)時(shí)使用的。 例如子組件為 child.vue template: '<div>msg: {{msg}}</div>' props: ['msg'], 我們?cè)谧咏M件里規(guī)定了一個(gè)數(shù)據(jù)名字叫msg 父組件里面寫(xiě) <child msg=hello, v

vue-prop是父組件向子組件進(jìn)行傳遞數(shù)據(jù)時(shí)使用的。
例如子組件為
child.vue
template: '<div>msg: {{msg}}</div>'
props: ['msg'],
我們?cè)谧咏M件里規(guī)定了一個(gè)數(shù)據(jù)名字叫msg
父組件里面寫(xiě)
<child msg="hello, vue.js!"></child>
這樣我們就可以在子組件里看到msg:hello, vue.js!
以上這篇vue-prop父組件向子組件進(jìn)行傳值的方法就是小編分享給大家的全部?jī)?nèi)容了,希望能給大家一個(gè)參考,也希望大家多多支持腳本之家。
聲明:本網(wǎng)頁(yè)內(nèi)容旨在傳播知識(shí),若有侵權(quán)等問(wèn)題請(qǐng)及時(shí)與本網(wǎng)聯(lián)系,我們將在第一時(shí)間刪除處理。TEL:177 7030 7066 E-MAIL:11247931@qq.com
vue-prop父組件向子組件進(jìn)行傳值的方法
vue-prop父組件向子組件進(jìn)行傳值的方法:vue-prop是父組件向子組件進(jìn)行傳遞數(shù)據(jù)時(shí)使用的。 例如子組件為 child.vue template: '<div>msg: {{msg}}</div>' props: ['msg'], 我們?cè)谧咏M件里規(guī)定了一個(gè)數(shù)據(jù)名字叫msg 父組件里面寫(xiě) <child msg=hello, v