UNPKG

vuux

Version:

Vue3 Nuxt3 Nuxt4 组件库

59 lines (58 loc) 1.98 kB
import { defineComponent as d, createElementBlock as o, openBlock as e, normalizeClass as c, unref as a, createCommentVNode as n, renderSlot as h, Fragment as m, createBlock as u, createStaticVNode as y, toDisplayString as g } from "vue"; import { useButton as k } from "./hook/useButton.mjs"; import { Icon as B } from "@vuux/icons"; const f = { key: 1, xmlns: "http://www.w3.org/2000/svg", class: "is-loading", width: "14", height: "14", viewBox: "0 0 24 24", fill: "currentColor", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" }, b = { key: 2, class: "is-badge" }, v = /* @__PURE__ */ d({ name: "Button", __name: "index", props: { type: { default: "primary" }, icon: {}, radius: { type: Boolean }, link: { type: Boolean }, text: { type: Boolean }, circle: { type: Boolean }, loading: { type: Boolean }, disabled: { type: Boolean }, badge: {}, size: { default: "l" } }, setup(s) { const t = s, { classNames: l, isLoading: r } = k(t); return (i, p) => (e(), o("button", { class: c(["app-button", a(l)]), type: "button" }, [ a(r) ? n("", !0) : (e(), o(m, { key: 0 }, [ t.icon ? (e(), u(a(B), { key: 0, name: t.icon, size: t.link || t.text ? 14 : 15, color: t.link || t.text ? `var(--app-${t.type})` : "rgba(255, 255, 255)" }, null, 8, ["name", "size", "color"])) : n("", !0) ], 64)), a(r) ? (e(), o("svg", f, [...p[0] || (p[0] = [ y('<path d="M12 2v4"></path><path d="m16.2 7.8 2.9-2.9"></path><path d="M18 12h4"></path><path d="m16.2 16.2 2.9 2.9"></path><path d="M12 18v4"></path><path d="m4.9 19.1 2.9-2.9"></path><path d="M2 12h4"></path><path d="m4.9 4.9 2.9 2.9"></path>', 8) ])])) : n("", !0), h(i.$slots, "default"), t.badge ? (e(), o("span", b, g(t.badge), 1)) : n("", !0) ], 2)); } }); export { v as default };