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