垮组件方法调用

eventBus.js

import Vue from 'vue';
const EventBus = new Vue()
export { EventBus }

navHead.vue(收到通知 触发orderService.vue中的列表)

import {EventBus} from '@/utils/eventBus.js'
EventBus.$emit('upTable')

orderService.vue

import {EventBus} from '@/utils/eventBus.js'
created() {
        EventBus.$on('upTable', () => {this.getList(1)
        })
    },

 

posted @ 2022-12-26 11:39  番茄西红柿u  阅读(26)  评论(0编辑  收藏  举报