Files
workspace/code/g3hd/frontend/src/components/g3-file/index.js
T
2026-07-11 17:30:09 +08:00

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);
}