OnlySelf

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

2020年11月19日

摘要: vue中的$emit 与$on父子组件与兄弟组件的之间通信方式 本文主要对vue 用$emit 与 $on 来进行组件之间的数据传输。重点给大家介绍vue中的$emit 与$on父子组件与兄弟组件的之间通信方式。 本文主要对vue 用$emit 与 $on 来进行组件之间的数据传输. 主要的传输方式 阅读全文
posted @ 2020-11-19 14:45 OnlySelf 阅读(1338) 评论(0) 推荐(0)

摘要: Vue 中非父子组件间的传值 总线机制 非父子之间传值,可以采用发布订阅模式,这种模式在 Vue 中被称为总线机制,或者叫做Bus / 发布订阅模式 / 观察者模式 <div id="root"> <child content="Dell"></child> <child content="Lee" 阅读全文
posted @ 2020-11-19 14:38 OnlySelf 阅读(200) 评论(0) 推荐(0)

摘要: vue父子传值(一) 参考一: 父组件向子组件传值: parent: <parent> <child :message="msg"></child></parent> data(){ return { msg: "this is parent message" }}child: <div> <p>{ 阅读全文
posted @ 2020-11-19 14:17 OnlySelf 阅读(688) 评论(0) 推荐(0)