vue-files-preview
Version:
A tool for previewing files such as doc, excel, pdf, image, markdown, txt, audio, and video and so on.
42 lines (41 loc) • 1.3 kB
JavaScript
import { defineComponent as c, ref as i, watch as d, openBlock as f, createElementBlock as u, createVNode as a, unref as s } from "vue";
import m from "../../../../node_modules/.pnpm/@vue-office_docx@1.6.2_vue-demi@0.14.8_vue@3.5.11_typescript@5.4.2___vue@3.5.11_typescript@5.4.2_/node_modules/@vue-office/docx/lib/index.mjs";
/* empty css */
import { getFileRenderByFile as p } from "../../utils/utils.mjs";
const _ = { class: "docx-preview" }, R = /* @__PURE__ */ c({
__name: "index",
props: {
file: { default: () => null },
url: { default: () => null },
name: {}
},
setup(o) {
const e = o, r = i(null);
d(
() => e.file,
() => {
p(e.file).then((n) => {
r.value = n;
});
},
{ immediate: !0 }
);
function l() {
console.log("渲染完成");
}
function t() {
console.log("渲染失败");
}
return (n, x) => (f(), u("div", _, [
a(s(m), {
src: r.value,
onRendered: l,
onError: t
}, null, 8, ["src"])
]));
}
});
export {
R as default
};
//# sourceMappingURL=index.vue.mjs.map