This commit is contained in:
Harvey authored and Harvey Zack committed 2022-05-05 23:27:15 +08:00
1 parent a39a64b3b1
commit c9e8d891e1
11 files changed
+9364 -82

No files matched your search

@@ -1,14 +1,35 @@
import { createApp } from 'vue';
import App from './App.vue';
export default class Control {
constructor(danmuku) {
constructor(art, danmuku) {
this.art = art;
this.danmuku = danmuku;
this.apps = new Map();
}
mount() {
//
mount($el) {
const that = this;
const app = createApp(App);
app.use({
install(app) {
app.config.globalProperties.$art = that.art;
app.config.globalProperties.$danmuku = that.danmuku;
},
});
app.mount($el);
this.apps.set($el, app);
return app;
}
unmount() {
//
unmount($el) {
const app = this.apps.get($el);
if (app) {
app.unmount();
this.apps.delete($el);
}
}
}