mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-30 03:51:25 -08:00
add vue
This commit is contained in:
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user