优化获取位置、更换控制方向图片
parent
e687e1c1cd
commit
c4efebbfc5
Binary file not shown.
After Width: | Height: | Size: 10 KiB |
Binary file not shown.
After Width: | Height: | Size: 13 KiB |
Binary file not shown.
After Width: | Height: | Size: 12 KiB |
Binary file not shown.
After Width: | Height: | Size: 10 KiB |
@ -0,0 +1,15 @@
|
||||
// eventBus
|
||||
import { reactive } from 'vue';
|
||||
|
||||
export const EventBus = reactive({
|
||||
events: {},
|
||||
emit(event, data) {
|
||||
this.events[event] && this.events[event].forEach((callback) => callback(data));
|
||||
},
|
||||
on(event, callback) {
|
||||
if (!this.events[event]) {
|
||||
this.events[event] = [];
|
||||
}
|
||||
this.events[event].push(callback);
|
||||
},
|
||||
});
|
Loading…
Reference in New Issue