Files
aida_front/src/tool/mount.js
X1627315083 e876abf3df 修复bug
2024-07-09 19:10:01 +08:00

17 lines
587 B
JavaScript

import { createApp } from "vue";
import scaleVideo from "@/component/HomePage/scaleVideo.vue";
// 使用vue3的createApp,以及mount,unmount方法创建挂载实例
export default function showViewVideo(options) {
// 创建一个节点,并将组件挂载上去
const mountNode = document.createElement("div");
document.body.appendChild(mountNode);
const glearVideo = createApp(scaleVideo, {
...options,
visible: true,
remove() {
glearVideo.unmount(); //创建完后要进行销毁
document.body.removeChild(mountNode);
},
});
return glearVideo.mount(mountNode);
}