UNPKG

ivue-material-plus

Version:

A high quality UI components Library with Vue.js

110 lines (107 loc) 5.41 kB
import _sfc_main from './upload-list.vue_vue_type_script_lang.mjs'; import { resolveComponent, resolveDirective, openBlock, createElementBlock, normalizeClass, Fragment, renderList, withDirectives, createCommentVNode, createElementVNode, normalizeStyle, renderSlot, createVNode, withCtx, createTextVNode, Transition, createBlock, toDisplayString, withModifiers, vShow } from 'vue'; import _export_sfc from '../../_virtual/_plugin-vue_export-helper.mjs'; const _hoisted_1 = ["onClick"]; const _hoisted_2 = ["src"]; function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) { const _component_ivue_icon = resolveComponent("ivue-icon"); const _directive_ivue_loading = resolveDirective("ivue-loading"); return openBlock(), createElementBlock("ul", { class: normalizeClass(_ctx.prefixCls) }, [ (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.files, (file, index) => { return withDirectives((openBlock(), createElementBlock("li", { key: file.uid, class: normalizeClass(_ctx.fileStatusClass(file)) }, [ createCommentVNode(" \u56FE\u7247 "), createElementVNode("div", { class: normalizeClass(_ctx.imageClass(file)), onClick: ($event) => _ctx.handleFileData(file, index), style: normalizeStyle(_ctx.getSizeStyle(file.previewSize || _ctx.previewSize)) }, [ createElementVNode("img", { src: file.content || file.url, class: normalizeClass(`${_ctx.prefixCls}-image__img`), style: normalizeStyle(_ctx.imgStyle(file)) }, null, 14, _hoisted_2), createCommentVNode(" \u81EA\u5B9A\u4E49\u9884\u89C8\u56FE\u7247\u533A\u57DF\u5185\u5BB9 "), createElementVNode("div", { class: normalizeClass(`${_ctx.prefixCls}-preview--image`) }, [ renderSlot(_ctx.$slots, "preview-image", {}, () => [ createCommentVNode(" \u9884\u89C8\u56FE\u6807 "), createVNode(_component_ivue_icon, { class: normalizeClass(`${_ctx.prefixCls}-preview-icon`) }, { default: withCtx(() => [ createTextVNode("visibility") ]), _: 1 }, 8, ["class"]) ]) ], 2) ], 14, _hoisted_1), createCommentVNode(" \u8499\u5C42 "), createVNode(Transition, { name: "fade" }, { default: withCtx(() => [ _ctx.currentStatus(file) ? (openBlock(), createElementBlock("div", { key: 0, class: normalizeClass(`${_ctx.prefixCls}-mask`) }, [ createCommentVNode(" \u52A0\u8F7D\u4E2D "), file.status === "uploading" ? withDirectives((openBlock(), createElementBlock("div", { key: 0, class: normalizeClass(`${_ctx.prefixCls}-mask__loading`) }, null, 2)), [ [_directive_ivue_loading, file.status === "uploading"] ]) : createCommentVNode("v-if", true), createCommentVNode(" \u9519\u8BEF\u56FE\u6807 "), file.status === "failed" ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [ !_ctx.failedIcon ? (openBlock(), createBlock(_component_ivue_icon, { key: 0, class: normalizeClass(`${_ctx.prefixCls}-mask__icon`) }, { default: withCtx(() => [ createTextVNode("cancel") ]), _: 1 }, 8, ["class"])) : (openBlock(), createElementBlock("i", { key: 1, class: normalizeClass([`${_ctx.prefixCls}-mask__icon`, _ctx.failedIcon]) }, null, 2)) ], 64)) : createCommentVNode("v-if", true), createCommentVNode(" \u63CF\u8FF0\u7684\u4FE1\u606F "), file.message ? (openBlock(), createElementBlock("div", { key: 2, class: normalizeClass(`${_ctx.prefixCls}-mask__message`) }, toDisplayString(file.message), 3)) : createCommentVNode("v-if", true) ], 2)) : createCommentVNode("v-if", true) ]), _: 2 }, 1024), createCommentVNode(" \u5220\u9664\u6309\u94AE "), _ctx.isDeletable(file) ? (openBlock(), createBlock(_component_ivue_icon, { key: 0, class: normalizeClass(`${_ctx.prefixCls}-remove`), onClick: withModifiers(($event) => _ctx.handleRemove(file, index), ["stop"]) }, { default: withCtx(() => [ createTextVNode("close") ]), _: 2 }, 1032, ["class", "onClick"])) : createCommentVNode("v-if", true), createCommentVNode(" \u81EA\u5B9A\u4E49\u8986\u76D6\u5728\u9884\u89C8\u533A\u57DF\u4E0A\u65B9\u7684\u5185\u5BB9 "), _ctx.$slots["preview-cover"] ? renderSlot(_ctx.$slots, "preview-cover", { key: 1, file }) : createCommentVNode("v-if", true) ], 2)), [ [vShow, _ctx.isImageFile(file)] ]); }), 128)) ], 2); } var UploadList = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "D:\\louise\\person\\project\\GitHub\\ivue-ui-plus\\src\\components\\ivue-upload\\upload-list.vue"]]); export { UploadList as default }; //# sourceMappingURL=upload-list.mjs.map