添加教程下载 和调整作品详情
This commit is contained in:
18
src/tool/mount.js
Normal file
18
src/tool/mount.js
Normal file
@@ -0,0 +1,18 @@
|
||||
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);
|
||||
},
|
||||
});
|
||||
console.log(glearVideo.mount(mountNode));
|
||||
return glearVideo.mount(mountNode);
|
||||
}
|
||||
Reference in New Issue
Block a user