@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/).
51 lines (50 loc) • 2.04 kB
JavaScript
import '../mt-link.css';
"use strict";
const vue = require("vue");
const mtIcon_vue_vue_type_style_index_0_lang = require("../mt-icon.vue_vue_type_style_index_0_lang-0a28c7b6.js");
const _pluginVue_exportHelper = require("../_plugin-vue_export-helper-9c783a34.js");
const _sfc_main = /* @__PURE__ */ vue.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 vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(_ctx.as), vue.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: vue.withCtx(() => [
vue.renderSlot(_ctx.$slots, "default", {}, void 0, true),
_ctx.type ? (vue.openBlock(), vue.createBlock(mtIcon_vue_vue_type_style_index_0_lang._sfc_main, {
key: 0,
size: "0.75em",
name: _ctx.type === "external" ? "regular-external-link-s" : "regular-long-arrow-right"
}, null, 8, ["name"])) : vue.createCommentVNode("", true)
]),
_: 3
}, 16, ["class", "href", "role", "aria-disabled", "tabindex"]);
};
}
});
const mtLink_vue_vue_type_style_index_0_scoped_24156821_lang = "";
const MtLink = /* @__PURE__ */ _pluginVue_exportHelper._export_sfc(_sfc_main, [["__scopeId", "data-v-24156821"]]);
module.exports = MtLink;
//# sourceMappingURL=MtLink.js.map