UNPKG

yanzhen-design-vue

Version:

72 lines (71 loc) 3.25 kB
"use strict"; Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } }); const vue = require("vue"); const antDesignVue = require("ant-design-vue"); const iconsVue = require("@ant-design/icons-vue"); const uploadImagePreview = require("./upload-image-preview.cjs"); const useUploadImagePreview = require("./use-upload-image-preview.cjs"); const _sfc_main = /* @__PURE__ */ vue.defineComponent({ ...{ name: uploadImagePreview.uploadImagePreviewName }, __name: "upload-image-preview", props: uploadImagePreview.uploadImagePreviewProps, emits: uploadImagePreview.uploadImagePreviewEmits, setup(__props, { expose: __expose, emit: __emit }) { const ns = uploadImagePreview.uploadImagePreviewOptions.ns; const props = __props; const emit = __emit; const attrs = vue.useAttrs(); const { preview, imageListRef, exposeCtx, handleOpenPreviewImage } = useUploadImagePreview.useUploadImagePreview( props, emit ); __expose(exposeCtx); return (_ctx, _cache) => { return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [ (vue.openBlock(), vue.createBlock(vue.Teleport, { to: "body" }, [ vue.createElementVNode("div", { class: vue.normalizeClass(vue.unref(ns).b()), style: { "display": "none" } }, [ vue.createVNode(vue.unref(antDesignVue.ImagePreviewGroup), { preview: vue.unref(preview), list: vue.unref(imageListRef) }, { default: vue.withCtx(() => [ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(imageListRef), (item) => { return vue.openBlock(), vue.createBlock(vue.unref(antDesignVue.Image), { key: (item == null ? void 0 : item.src) ?? item.uid, style: vue.normalizeStyle([{ "display": "none" }, [item.style]]), class: vue.normalizeClass([item.class]), width: item.width, src: item.src, preview: { visible: item.visible, onVisibleChange: item.onVisibleChange } }, null, 8, ["style", "class", "width", "src", "preview"]); }), 128)) ]), _: 1 }, 8, ["preview", "list"]) ], 2) ])), vue.renderSlot(_ctx.$slots, "default", vue.normalizeProps(vue.guardReactiveProps(vue.unref(exposeCtx))), () => [ vue.createVNode(vue.unref(antDesignVue.Button), { class: vue.normalizeClass(vue.unref(attrs).class), style: vue.normalizeStyle(vue.unref(attrs).style), icon: vue.h(vue.unref(iconsVue.FileImageOutlined)), type: "link", onClick: _cache[0] || (_cache[0] = ($event) => vue.unref(handleOpenPreviewImage)()) }, { default: vue.withCtx(() => [ vue.createTextVNode(vue.toDisplayString(vue.unref(imageListRef).length), 1) ]), _: 1 }, 8, ["class", "style", "icon"]) ]) ], 64); }; } }); exports.default = _sfc_main;