yuang-framework-ui-pc
Version:
yuang-framework-ui-pc Library
95 lines (94 loc) • 3.37 kB
JavaScript
import { defineComponent, resolveComponent, openBlock, createBlock, mergeProps, createSlots, withCtx, createVNode, renderSlot, normalizeProps, guardReactiveProps } from "vue";
import { useLocale } from "../ele-config-provider/receiver";
import EleModal from "../ele-dialog/index";
import EleCropper from "../ele-cropper/index";
import { cropperModalProps, cropperModalEmits } from "./props";
const _sfc_main = defineComponent({
name: "EleCropperModal",
components: { EleModal, EleCropper },
props: cropperModalProps,
emits: cropperModalEmits,
setup(props, { emit }) {
const { lang } = useLocale("cropper", props);
const updateModelValue = (value) => {
emit("update:modelValue", value);
};
const handleDone = (result) => {
emit("done", result);
};
return { lang, updateModelValue, handleDone };
}
});
const _export_sfc = (sfc, props) => {
const target = sfc.__vccOpts || sfc;
for (const [key, val] of props) {
target[key] = val;
}
return target;
};
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
const _component_EleCropper = resolveComponent("EleCropper");
const _component_EleModal = resolveComponent("EleModal");
return openBlock(), createBlock(_component_EleModal, mergeProps({
width: "620px",
title: _ctx.lang.title
}, _ctx.modalProps || {}, {
modelValue: _ctx.modelValue,
"onUpdate:modelValue": _ctx.updateModelValue
}), createSlots({
default: withCtx(() => [
createVNode(_component_EleCropper, {
height: _ctx.height,
src: _ctx.src,
imageType: _ctx.imageType,
accept: _ctx.accept,
tools: _ctx.tools,
preview: _ctx.preview,
previewWidth: _ctx.previewWidth,
toBlob: _ctx.toBlob,
options: _ctx.options,
croppedOptions: _ctx.croppedOptions,
tooltip: _ctx.tooltip,
tooltipProps: _ctx.tooltipProps,
beforeUploadClick: _ctx.beforeUploadClick,
responsive: _ctx.responsive,
locale: _ctx.locale,
onDone: _ctx.handleDone
}, null, 8, ["height", "src", "imageType", "accept", "tools", "preview", "previewWidth", "toBlob", "options", "croppedOptions", "tooltip", "tooltipProps", "beforeUploadClick", "responsive", "locale", "onDone"])
]),
_: 2
}, [
_ctx.$slots.header ? {
name: "header",
fn: withCtx((slotProps) => [
renderSlot(_ctx.$slots, "header", normalizeProps(guardReactiveProps(slotProps || {})))
]),
key: "0"
} : void 0,
_ctx.$slots.footer ? {
name: "footer",
fn: withCtx((slotProps) => [
renderSlot(_ctx.$slots, "footer", normalizeProps(guardReactiveProps(slotProps || {})))
]),
key: "1"
} : void 0,
_ctx.$slots.maxIcon ? {
name: "maxIcon",
fn: withCtx((slotProps) => [
renderSlot(_ctx.$slots, "maxIcon", normalizeProps(guardReactiveProps(slotProps || {})))
]),
key: "2"
} : void 0,
_ctx.$slots.closeIcon ? {
name: "closeIcon",
fn: withCtx((slotProps) => [
renderSlot(_ctx.$slots, "closeIcon", normalizeProps(guardReactiveProps(slotProps || {})))
]),
key: "3"
} : void 0
]), 1040, ["title", "modelValue", "onUpdate:modelValue"]);
}
const index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
export {
index as default
};