vue-files-preview
Version:
A tool for previewing files such as doc, excel, pdf, image, markdown, txt, audio, and video and so on.
32 lines (31 loc) • 776 B
JavaScript
import { defineComponent as o, ref as c, watch as i, openBlock as a, createElementBlock as s, createElementVNode as u } from "vue";
import { getFileRenderByFile as m } from "../../utils/utils.mjs";
const d = { class: "pic-preview" }, p = ["src"], h = /* @__PURE__ */ o({
__name: "index",
props: {
file: { default: () => null },
url: { default: () => null },
name: {}
},
setup(n) {
const r = n, t = c(null);
return i(
() => r.file,
(e) => {
e && m(e).then((l) => {
t.value = l;
});
},
{ immediate: !0 }
), (e, l) => (a(), s("div", d, [
u("img", {
src: t.value,
alt: ""
}, null, 8, p)
]));
}
});
export {
h as default
};
//# sourceMappingURL=index.vue.mjs.map