@arco-design/web-vue
Version:
Arco Design Vue 2.0: A Vue.js 3 UI Library
77 lines (76 loc) • 2.79 kB
JavaScript
import { defineComponent, computed, openBlock, createElementBlock, normalizeClass, normalizeStyle, createElementVNode } from "vue";
import { getPrefixCls } from "../../_utils/global-config.js";
import { isNumber } from "../../_utils/is.js";
import _export_sfc from "../../_virtual/plugin-vue_export-helper.js";
const _sfc_main = defineComponent({
name: "IconGift",
props: {
size: {
type: [Number, String]
},
strokeWidth: {
type: Number,
default: 4
},
strokeLinecap: {
type: String,
default: "butt",
validator: (value) => {
return ["butt", "round", "square"].includes(value);
}
},
strokeLinejoin: {
type: String,
default: "miter",
validator: (value) => {
return ["arcs", "bevel", "miter", "miter-clip", "round"].includes(value);
}
},
rotate: Number,
spin: Boolean
},
emits: {
click: (ev) => true
},
setup(props, { emit }) {
const prefixCls = getPrefixCls("icon");
const cls = computed(() => [prefixCls, `${prefixCls}-gift`, { [`${prefixCls}-spin`]: props.spin }]);
const innerStyle = computed(() => {
const styles = {};
if (props.size) {
styles.fontSize = isNumber(props.size) ? `${props.size}px` : props.size;
}
if (props.rotate) {
styles.transform = `rotate(${props.rotate}deg)`;
}
return styles;
});
const onClick = (ev) => {
emit("click", ev);
};
return {
cls,
innerStyle,
onClick
};
}
});
const _hoisted_1 = ["stroke-width", "stroke-linecap", "stroke-linejoin"];
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return openBlock(), createElementBlock("svg", {
viewBox: "0 0 48 48",
fill: "none",
xmlns: "http://www.w3.org/2000/svg",
stroke: "currentColor",
class: normalizeClass(_ctx.cls),
style: normalizeStyle(_ctx.innerStyle),
"stroke-width": _ctx.strokeWidth,
"stroke-linecap": _ctx.strokeLinecap,
"stroke-linejoin": _ctx.strokeLinejoin,
onClick: _cache[0] || (_cache[0] = (...args) => _ctx.onClick && _ctx.onClick(...args))
}, _cache[1] || (_cache[1] = [
createElementVNode("path", { d: "M13.45 14.043H8a1 1 0 0 0-1 1v8a1 1 0 0 0 1 1h32a1 1 0 0 0 1-1v-8a1 1 0 0 0-1-1h-4.893m-21.657 0c-1.036-2.833-.615-5.6 1.182-6.637 2.152-1.243 5.464.464 7.397 3.812.539.933.914 1.896 1.127 2.825m-9.706 0h9.706m0 0H25.4m0 0a10.31 10.31 0 0 1 1.128-2.825c1.933-3.348 5.244-5.055 7.397-3.812 1.797 1.037 2.217 3.804 1.182 6.637m-9.707 0h9.707M10 26.043a2 2 0 0 1 2-2h24a2 2 0 0 1 2 2v13a2 2 0 0 1-2 2H12a2 2 0 0 1-2-2v-13Z" }, null, -1)
]), 14, _hoisted_1);
}
var _IconGift = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
export { _IconGift as default };