gin-vue-admin 2.0代码重构
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
const install = (Vue) => {
|
||||
const Bus = new Vue({
|
||||
methods: {
|
||||
emit(event, ...args) {
|
||||
this.$emit(event, ...args)
|
||||
},
|
||||
on(event, cb) {
|
||||
this.$on(event, cb)
|
||||
},
|
||||
off(event, cb) {
|
||||
this.$off(event, cb)
|
||||
}
|
||||
},
|
||||
})
|
||||
Vue.prototype.$bus = Bus
|
||||
}
|
||||
|
||||
export default install
|
||||
Reference in New Issue
Block a user