UNPKG

@shopware-ag/meteor-component-library

Version:

The meteor component library is a Vue component library developed by Shopware. It is based on the [Meteor Design System](https://shopware.design/).

52 lines (51 loc) 2.02 kB
import '../mt-link.css'; import { defineComponent, openBlock, createBlock, resolveDynamicComponent, mergeProps, withCtx, renderSlot, createCommentVNode } from "vue"; import { _ as _sfc_main$1 } from "../mt-icon.vue_vue_type_style_index_0_lang-2cc5f73e.mjs"; import { _ as _export_sfc } from "../_plugin-vue_export-helper-cc2b3d55.mjs"; const _sfc_main = /* @__PURE__ */ defineComponent({ __name: "mt-link", props: { to: {}, as: { default: "router-link" }, variant: { default: "primary" }, disabled: { type: Boolean, default: false }, type: {} }, emits: ["click"], setup(__props) { return (_ctx, _cache) => { return openBlock(), createBlock(resolveDynamicComponent(_ctx.as), mergeProps({ class: [ "mt-link", `mt-link--${_ctx.variant}`, { "mt-link--disabled": _ctx.disabled, [`mt-link--${_ctx.type}`]: _ctx.type !== void 0 } ], href: _ctx.disabled ? void 0 : _ctx.to, role: _ctx.as === "a" ? "link" : void 0, "aria-disabled": _ctx.disabled, tabindex: _ctx.disabled ? -1 : 0 }, _ctx.to ? { ..._ctx.$attrs, to: _ctx.to } : _ctx.$attrs, { onClick: _cache[0] || (_cache[0] = ($event) => _ctx.disabled ? void 0 : _ctx.$emit("click", $event)) }), { default: withCtx(() => [ renderSlot(_ctx.$slots, "default", {}, void 0, true), _ctx.type ? (openBlock(), createBlock(_sfc_main$1, { key: 0, size: "0.75em", name: _ctx.type === "external" ? "regular-external-link-s" : "regular-long-arrow-right" }, null, 8, ["name"])) : createCommentVNode("", true) ]), _: 3 }, 16, ["class", "href", "role", "aria-disabled", "tabindex"]); }; } }); const mtLink_vue_vue_type_style_index_0_scoped_24156821_lang = ""; const MtLink = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-24156821"]]); export { MtLink as default }; //# sourceMappingURL=MtLink.js.map