45 lines
805 B
JavaScript
45 lines
805 B
JavaScript
import { createVNode, getCurrentInstance, render } from "vue";
|
|
import File from "./index.vue";
|
|
|
|
export function showfile(
|
|
moduleid,
|
|
father,
|
|
cateid = "",
|
|
searchcondition = "",
|
|
readonly = false,
|
|
categories = [],
|
|
) {
|
|
const container = document.createElement("div");
|
|
document.body.appendChild(container);
|
|
|
|
const vnode = createVNode(File, {
|
|
father,
|
|
moduleid,
|
|
cateid,
|
|
searchcondition,
|
|
readonly,
|
|
categories,
|
|
|
|
modelValue: true,
|
|
"onUpdate:modelValue": (val) => {
|
|
if (!val) close();
|
|
},
|
|
|
|
onClosed: () => {
|
|
close();
|
|
},
|
|
});
|
|
|
|
const instance = getCurrentInstance();
|
|
if (instance) {
|
|
vnode.appContext = instance.appContext;
|
|
}
|
|
|
|
function close() {
|
|
render(null, container);
|
|
container.remove();
|
|
}
|
|
|
|
render(vnode, container);
|
|
}
|