vue3版本初版上线 自测已可用
This commit is contained in:
+5
-17
@@ -1,18 +1,6 @@
|
||||
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
|
||||
// using ES6 modules
|
||||
import mitt from 'mitt'
|
||||
|
||||
export const emitter = mitt()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user