hongluan-ui
Version:
Hongluan Component Library for Vue 3
49 lines (44 loc) • 1.74 kB
JavaScript
;
Object.defineProperty(exports, '__esModule', { value: true });
var vue = require('vue');
require('../../../hooks/index.js');
var link = require('./link.js');
var index = require('../../../hooks/use-namespace/index.js');
const __default__ = vue.defineComponent({
name: "Link"
});
const _sfc_main = /* @__PURE__ */ vue.defineComponent({
...__default__,
props: link.linkProps,
emits: link.linkEmits,
setup(__props, { emit }) {
const props = __props;
const { namespace } = index.useNamespace("link");
function handleClick(event) {
if (!props.disabled)
emit("click", event);
}
return (_ctx, _cache) => {
return vue.openBlock(), vue.createElementBlock("a", {
class: vue.normalizeClass({
[vue.unref(namespace)]: true,
"is-underline": _ctx.underline === true && !_ctx.disabled,
"is-hover-underline": _ctx.underline === "hover" && !_ctx.disabled,
"is-disabled": _ctx.disabled,
[_ctx.type]: true
}),
target: _ctx.disabled || !_ctx.href ? void 0 : _ctx.target,
href: _ctx.disabled || !_ctx.href ? void 0 : _ctx.href,
onClick: handleClick
}, [
_ctx.$slots.prefix ? vue.renderSlot(_ctx.$slots, "prefix", { key: 0 }) : vue.createCommentVNode("v-if", true),
_ctx.$slots.default ? (vue.openBlock(), vue.createElementBlock("span", { key: 1 }, [
vue.renderSlot(_ctx.$slots, "default")
])) : vue.createCommentVNode("v-if", true),
_ctx.$slots.suffix ? vue.renderSlot(_ctx.$slots, "suffix", { key: 2 }) : vue.createCommentVNode("v-if", true)
], 10, ["target", "href"]);
};
}
});
exports["default"] = _sfc_main;
//# sourceMappingURL=link2.js.map