vue-prop父组件向子组件进行传值

vue-prop是父组件向子组件进行传递数据时使用的。
例如子组件为
child.vue

 template: '<div>msg: {{msg}}</div>'
 props: ['msg'],

我们在子组件里规定了一个数据名字叫msg
父组件里面写

<child msg="hello, vue.js!"></child>

这样我们就可以在子组件里看到msg:hello, vue.js!

posted on 2017-02-06 17:01  fxxk院子  阅读(40)  评论(0)    收藏  举报

导航