学习:vue官网教程
组件注册:

父子组件之间的传值方式:
1、父传子
父组件:v-bind
子组件:props 得到相应的值,但是子组件中不能修改传过来的值。

2、子传父
父组件:v-on监听传送事件
子组件:this.$emit() 触发事件
3、兄弟组件
兄组件:$.on接收

弟组件:this.$emit() 触发事件

bus.js中间传输件,两个兄弟组件中都应该import 中间的bus.js

练习:饿了么商家页面的模仿,公司的列表管理
学习:vue官网教程
组件注册:
父子组件之间的传值方式:
1、父传子
父组件:v-bind
子组件:props 得到相应的值,但是子组件中不能修改传过来的值。
2、子传父
父组件:v-on监听传送事件
子组件:this.$emit() 触发事件
3、兄弟组件
兄组件:$.on接收
弟组件:this.$emit() 触发事件
bus.js中间传输件,两个兄弟组件中都应该import 中间的bus.js
练习:饿了么商家页面的模仿,公司的列表管理
本文标题:2018-10-31 vue框架(1)组件
本文链接:https://www.haomeiwen.com/subject/gmwatqtx.html
网友评论