UNPKG

@open-data-v/ui

Version:

OpenDataV UI基础包

47 lines (46 loc) 1.49 kB
import { defineComponent as f, inject as i, ref as b, computed as m, openBlock as y, createElementBlock as B, mergeProps as h, withModifiers as k, renderSlot as s } from "vue"; const w = /* @__PURE__ */ f({ __name: "Button", props: { type: { default: "" }, size: { default: "" }, icon: { default: "" }, round: { type: Boolean, default: !1 }, disabled: { type: Boolean, default: !1 }, width: { default: "" }, name: { default: "" }, plain: { type: Boolean }, circle: { type: Boolean }, bordered: { type: Boolean, default: !0 } }, emits: ["click"], setup(a, { emit: d }) { const e = a, r = d, o = i("OGroupConfig", {}), l = i("OBtnClick", ""), c = b(e.width || o.width), u = m(() => { const t = e.size || o.size || "", n = { "o-btn": !0, "is-round": e.round || o.round, disabled: e.disabled, [t]: t, "is-plain": e.plain || o.plain, "is-circle": e.circle || o.plain, ["o-btn-" + (e.type || "default")]: !0 }; return e.bordered || (n["o-btn-bordered"] = !0), n; }), p = (t) => { e.disabled || (r("click", t), l && l(t, e.name)); }; return (t, n) => (y(), B("button", h(t.$attrs, { type: "button", class: u.value, style: { width: c.value }, onClick: k(p, ["prevent"]) }), [ s(t.$slots, "icon"), s(t.$slots, "default") ], 16)); } }); export { w as default }; //# sourceMappingURL=Button.vue.esm.js.map