123
parent
a3b191aa46
commit
2d68d041fb
@ -0,0 +1,19 @@
|
|||||||
|
import { createApp } from 'vue';
|
||||||
|
import imgModalPopup from '@/components/imgModal/index.vue'
|
||||||
|
|
||||||
|
export default function useImgModalPopup() {
|
||||||
|
function showImgModal(obj) {
|
||||||
|
const instance = createApp(imgModalPopup,{
|
||||||
|
//监听消息关闭事件
|
||||||
|
onClose:()=>{
|
||||||
|
instance.unmount();
|
||||||
|
document.body.removeChild(mountNode);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
const mountNode = document.createElement('div');
|
||||||
|
document.body.appendChild(mountNode);
|
||||||
|
const vm = instance.mount(mountNode);
|
||||||
|
vm.showImgModal(obj)
|
||||||
|
}
|
||||||
|
return { showImgModal };
|
||||||
|
}
|
Loading…
Reference in New Issue