vue2.0 #$emit,$on的使用
生活随笔
收集整理的這篇文章主要介紹了
vue2.0 #$emit,$on的使用
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
首先實例化:
bus.js
import Vue from 'Vue' export default new Vue()?
組件1,
import bus from '../../assets/js/bus.js'fun(myDate){ bus.$emit('G_ievent',myDate); }組件2,
mounted(){ //兩種接收的方式bus.$on('G_ievent',(date) =>{//this.timelist(date)})},?
轉載于:https://www.cnblogs.com/gavin1024/p/9515618.html
與50位技術專家面對面20年技術見證,附贈技術全景圖總結
以上是生活随笔為你收集整理的vue2.0 #$emit,$on的使用的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Reinforcement Learni
- 下一篇: 小程序-demo:小程序示例-page/