UNPKG

@extclp/vexip-ui

Version:

A Vue 3 UI library, Highly customizability, full TypeScript, performance pretty good

64 lines (63 loc) 1.75 kB
import { defineComponent as p, computed as d, createElementBlock as m, openBlock as o, unref as n, normalizeClass as l, renderSlot as s, createBlock as f, createCommentVNode as b } from "vue"; import "../icon/index.mjs"; import { useProps as k, createIconProp as _, useNameHelper as h, emitEvent as y } from "@vexip-ui/config"; import { linkerProps as C } from "./props.mjs"; import g from "../icon/icon.mjs"; const v = ["href", "target"], j = /* @__PURE__ */ p({ name: "Linker", __name: "linker", props: C, setup(a) { const i = Object.freeze([ "default", "primary", "success", "error", "warning", "info" ]), e = k("linker", a, { to: { default: null, static: !0 }, type: { default: "default", validator: (t) => i.includes(t) }, icon: _(), underline: !1, disabled: !1, target: "_blank" }), r = h("linker"), c = d(() => ({ [r.b()]: !0, [r.bs("vars")]: !0, [r.bm("inherit")]: e.inherit, [r.bm(e.type)]: e.type !== "default", [r.bm("disabled")]: e.disabled, [r.bm("underline")]: e.underline })); function u(t) { e.disabled && t.preventDefault(), y(e.onClick, t); } return (t, N) => (o(), m("a", { class: l(c.value), href: n(e).to, tabindex: "0", target: n(e).target, onClick: u }, [ s(t.$slots, "icon", {}, () => [ n(e).icon ? (o(), f(n(g), { key: 0, class: l(n(r).be("icon")), icon: n(e).icon }, null, 8, ["class", "icon"])) : b("", !0) ]), s(t.$slots, "default") ], 10, v)); } }); export { j as default }; //# sourceMappingURL=linker.vue2.mjs.map