17 lines
587 B
JavaScript
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);
|
|
} |