UNPKG

@aplus-frontend/ui

Version:

60 lines (59 loc) 1.75 kB
import { defineComponent as a, useSlots as m, createBlock as f, openBlock as d, mergeProps as u, unref as k, createSlots as y, renderList as P, withCtx as B, renderSlot as C, normalizeProps as _, guardReactiveProps as g } from "vue"; import { confirmHandle as b } from "./utils/index.mjs"; import { omit as i } from "lodash-unified"; import "./ap-button.vue2.mjs"; import h from "./ap-button.vue.mjs"; const w = /* @__PURE__ */ a({ __name: "ap-confirm-button", props: { prefixCls: {}, htmlType: {}, shape: {}, size: {}, loading: { type: [Boolean, Object] }, disabled: { type: Boolean }, ghost: { type: Boolean }, block: { type: Boolean }, danger: { type: Boolean }, icon: {}, href: {}, target: {}, title: {}, onMousedown: {}, autoInsertSpace: { type: Boolean }, iconPosition: {}, color: {}, variant: {}, type: {}, borderLinkColor: {}, minWidth: { type: [Boolean, Number, String] }, lazy: { type: [Boolean, Number] }, onClick: {}, content: {}, confirmProps: { default: () => ({}) } }, setup(c) { const o = c, s = m(), l = () => { const t = o.confirmProps?.onOk || o.onClick, n = o.confirmProps?.title || o.title, r = o.confirmProps?.content || o.content, e = { centered: !0, // 默认居中 onOk: t, title: n, content: r, ...i(o.confirmProps, ["onOk", "title", "content"]) }; b(e); }; return (t, n) => (d(), f(h, u(k(i)(o, ["confirmProps", "onClick"]), { onClick: l }), y({ _: 2 }, [ P(s, (r, e) => ({ name: e, fn: B((p) => [ C(t.$slots, e, _(g(p || {}))) ]) })) ]), 1040)); } }); export { w as default };