ivue-material-plus
Version:
A high quality UI components Library with Vue.js
141 lines (138 loc) • 6.82 kB
JavaScript
import _sfc_main from './index.vue_vue_type_script_lang.mjs';
import { resolveComponent, openBlock, createElementBlock, normalizeClass, createCommentVNode, withDirectives, withModifiers, renderSlot, createElementVNode, normalizeStyle, createVNode, withCtx, createTextVNode, vShow, createBlock, createSlots } from 'vue';
import _export_sfc from '../../_virtual/_plugin-vue_export-helper.mjs';
const _hoisted_1 = ["accept", "multiple", "capture"];
const _hoisted_2 = ["accept", "multiple", "capture"];
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
const _component_ivue_icon = resolveComponent("ivue-icon");
const _component_upload_list = resolveComponent("upload-list");
const _component_image_preview = resolveComponent("image-preview");
return openBlock(), createElementBlock("div", {
class: normalizeClass(_ctx.prefixCls)
}, [
createCommentVNode(" \u4E0A\u4F20\u6846\u5DE6\u8FB9 "),
_ctx.uploadDirection === "left" ? withDirectives((openBlock(), createElementBlock("div", {
key: 0,
class: normalizeClass(_ctx.inputWrapClasses),
onClick: _cache[1] || (_cache[1] = (...args) => _ctx.handleClickInput && _ctx.handleClickInput(...args)),
onDrop: _cache[2] || (_cache[2] = withModifiers((...args) => _ctx.handleDrag && _ctx.handleDrag(...args), ["prevent"])),
onDragover: _cache[3] || (_cache[3] = withModifiers((...args) => _ctx.handleDragOver && _ctx.handleDragOver(...args), ["prevent"])),
onDragleave: _cache[4] || (_cache[4] = withModifiers((...args) => _ctx.handleDragleave && _ctx.handleDragleave(...args), ["prevent"]))
}, [
!_ctx.readonly ? (openBlock(), createElementBlock("input", {
key: 0,
type: "file",
ref: "input",
class: normalizeClass(`${_ctx.prefixCls}-input`),
accept: _ctx.accept,
multiple: _ctx.multiple,
capture: _ctx.capture,
onChange: _cache[0] || (_cache[0] = (...args) => _ctx.handleChange && _ctx.handleChange(...args))
}, null, 42, _hoisted_1)) : createCommentVNode("v-if", true),
renderSlot(_ctx.$slots, "default", {}, () => [
createElementVNode("div", {
class: normalizeClass(_ctx.inputContentClasses),
style: normalizeStyle(_ctx.getSizeStyle(_ctx.previewSize))
}, [
createCommentVNode(" \u56FE\u6807 "),
createVNode(_component_ivue_icon, {
class: normalizeClass(`${_ctx.prefixCls}-content__icon`)
}, {
default: withCtx(() => [
createTextVNode("cloud_upload")
]),
_: 1
}, 8, ["class"]),
createElementVNode("p", {
class: normalizeClass(`${_ctx.prefixCls}-content__text`)
}, "\u70B9\u51FB\u4E0A\u4F20", 2)
], 6)
])
], 34)), [
[vShow, _ctx.renderUpload]
]) : createCommentVNode("v-if", true),
createCommentVNode(" \u5217\u8868 "),
_ctx.previewImage ? (openBlock(), createBlock(_component_upload_list, {
key: 1,
files: _ctx.data.fileList,
failedIcon: _ctx.failedIcon,
deletable: _ctx.deletable,
name: _ctx.name,
previewSize: _ctx.previewSize,
beforeDelete: _ctx.beforeDelete,
previewFullImage: _ctx.previewFullImage,
imageFit: _ctx.imageFit,
onOnDelete: _ctx.handleRemove,
onOnPreview: _ctx.handlePreview
}, createSlots({ _: 2 }, [
_ctx.$slots["preview-cover"] ? {
name: "preview-cover",
fn: withCtx(({ file }) => [
renderSlot(_ctx.$slots, "preview-cover", { file })
]),
key: "0"
} : void 0,
_ctx.$slots["preview-image"] ? {
name: "preview-image",
fn: withCtx(() => [
renderSlot(_ctx.$slots, "preview-image")
]),
key: "1"
} : void 0
]), 1032, ["files", "failedIcon", "deletable", "name", "previewSize", "beforeDelete", "previewFullImage", "imageFit", "onOnDelete", "onOnPreview"])) : createCommentVNode("v-if", true),
createCommentVNode(" \u653E\u5927\u56FE\u7247 "),
createVNode(_component_image_preview, {
transfer: "",
bodyOverflow: _ctx.bodyOverflow,
previewList: _ctx.data.imagePreviewList,
initialIndex: _ctx.data.imagePreviewInitialIndex,
modelValue: _ctx.data.imagePreview,
"onUpdate:modelValue": _cache[5] || (_cache[5] = ($event) => _ctx.data.imagePreview = $event),
onOnClose: _ctx.handleClosePreview
}, null, 8, ["bodyOverflow", "previewList", "initialIndex", "modelValue", "onOnClose"]),
createCommentVNode(" \u4E0A\u4F20\u6846\u53F3\u8FB9 "),
_ctx.uploadDirection === "right" ? withDirectives((openBlock(), createElementBlock("div", {
key: 2,
class: normalizeClass(_ctx.inputWrapClasses),
onClick: _cache[7] || (_cache[7] = (...args) => _ctx.handleClickInput && _ctx.handleClickInput(...args)),
onDrop: _cache[8] || (_cache[8] = withModifiers((...args) => _ctx.handleDrag && _ctx.handleDrag(...args), ["prevent"])),
onDragover: _cache[9] || (_cache[9] = withModifiers((...args) => _ctx.handleDragOver && _ctx.handleDragOver(...args), ["prevent"])),
onDragleave: _cache[10] || (_cache[10] = withModifiers((...args) => _ctx.handleDragleave && _ctx.handleDragleave(...args), ["prevent"]))
}, [
!_ctx.readonly ? (openBlock(), createElementBlock("input", {
key: 0,
type: "file",
ref: "input",
class: normalizeClass(`${_ctx.prefixCls}-input`),
accept: _ctx.accept,
multiple: _ctx.multiple,
capture: _ctx.capture,
onChange: _cache[6] || (_cache[6] = (...args) => _ctx.handleChange && _ctx.handleChange(...args))
}, null, 42, _hoisted_2)) : createCommentVNode("v-if", true),
renderSlot(_ctx.$slots, "default", {}, () => [
createElementVNode("div", {
class: normalizeClass(_ctx.inputContentClasses),
style: normalizeStyle(_ctx.getSizeStyle(_ctx.previewSize))
}, [
createCommentVNode(" \u56FE\u6807 "),
createVNode(_component_ivue_icon, {
class: normalizeClass(`${_ctx.prefixCls}-content__icon`)
}, {
default: withCtx(() => [
createTextVNode("cloud_upload")
]),
_: 1
}, 8, ["class"]),
createElementVNode("p", {
class: normalizeClass(`${_ctx.prefixCls}-content__text`)
}, "\u70B9\u51FB\u4E0A\u4F20", 2)
], 6)
])
], 34)), [
[vShow, _ctx.renderUpload]
]) : createCommentVNode("v-if", true)
], 2);
}
var Upload = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "D:\\louise\\person\\project\\GitHub\\ivue-ui-plus\\src\\components\\ivue-upload\\index.vue"]]);
export { Upload as default };
//# sourceMappingURL=index2.mjs.map