UNPKG

yanzhen-design-vue

Version:

38 lines (37 loc) 1.2 kB
import { defineComponent, openBlock, createBlock, unref, mergeProps, createSlots, renderList, withCtx, renderSlot, normalizeProps, guardReactiveProps } from "vue"; import { Modal } from "ant-design-vue"; import { modalName, modalProps, modalEmits, modalOptions } from "./modal.mjs"; import { useModal } from "./use-modal.mjs"; const _sfc_main = /* @__PURE__ */ defineComponent({ ...{ name: modalName }, __name: "modal", props: modalProps, emits: modalEmits, setup(__props, { emit: __emit }) { const ns = modalOptions.ns; const props = __props; const emit = __emit; const { ctx: { modalProps: _props, slotKeys } } = useModal(props, emit); return (_ctx, _cache) => { return openBlock(), createBlock(unref(Modal), mergeProps({ class: [unref(ns).b()] }, unref(_props)), createSlots({ _: 2 }, [ renderList(unref(slotKeys), (slot) => { return { name: slot, fn: withCtx((slotProps) => [ renderSlot(_ctx.$slots, slot, normalizeProps(guardReactiveProps(slotProps))) ]) }; }) ]), 1040, ["class"]); }; } }); export { _sfc_main as default };