中间页
middle-utils.js
import Vue from 'vue'
export default new Vue()
触发
import MiddleUtils from '@/common/utils/middle-utils'
change(){
MiddleUtils.$emit('changeNav', { key: '' })
}
接收
import MiddleUtils from '@/common/utils/middle-utils'
mounted() {
MiddleUtils.$on('changeNav', (value) => {
console.log('changeNav', value)
})
}