@arco-design/web-vue
Version:
Arco Design Vue 2.0: A Vue.js 3 UI Library
81 lines (80 loc) • 3.17 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: "IconGithub",
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}-github`, { [`${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: "M.056 24.618c0 10.454 6.7 19.344 16.038 22.608 1.259.32 1.067-.582 1.067-1.19v-4.148c-7.265.853-7.553-3.957-8.043-4.758-.987-1.686-3.312-2.112-2.62-2.912 1.654-.853 3.34.213 5.291 3.1 1.413 2.09 4.166 1.738 5.562 1.385a6.777 6.777 0 0 1 1.856-3.253C11.687 34.112 8.55 29.519 8.55 24.057c0-2.646.874-5.082 2.586-7.045-1.088-3.243.102-6.01.26-6.422 3.11-.282 6.337 2.225 6.587 2.421 1.766-.474 3.782-.73 6.038-.73 2.266 0 4.293.26 6.069.74.603-.458 3.6-2.608 6.49-2.345.155.41 1.317 3.12.294 6.315 1.734 1.968 2.62 4.422 2.62 7.077 0 5.472-3.158 10.07-10.699 11.397a6.82 6.82 0 0 1 2.037 4.875v6.02c.042.48 0 .96.806.96 9.477-3.194 16.299-12.15 16.299-22.697C47.938 11.396 37.218.68 23.996.68 10.77.675.055 11.391.055 24.617l.001.001Z",
fill: "currentColor",
stroke: "none"
}, null, -1)
]), 14, _hoisted_1);
}
var _IconGithub = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
export { _IconGithub as default };