UNPKG

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.31 kB
import { defineComponent as i, ref as d, watch as u, openBlock as a, createElementBlock as f, createVNode as s, unref as m } from "vue"; import p from "../../../../node_modules/.pnpm/@vue-office_excel@1.7.8_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/excel/lib/index.mjs"; /* empty css */ import { getFileRenderByFile as _ } from "../../utils/utils.mjs"; const h = { class: "xlsx-preview" }, B = /* @__PURE__ */ i({ __name: "index", props: { file: { default: () => null }, url: { default: () => null }, name: {}, width: {}, height: {} }, setup(o) { const l = o, r = d(null); u( () => l.file, (e) => { e && _(e).then((n) => r.value = n); }, { immediate: !0 } ); function t() { console.log("渲染完成"); } function c() { console.log("渲染失败"); } return (e, n) => (a(), f("div", h, [ s(m(p), { src: r.value, onRendered: t, onError: c }, null, 8, ["src"]) ])); } }); export { B as default }; //# sourceMappingURL=index.vue.mjs.map