@arco-design/web-vue
Version:
Arco Design Vue 2.0: A Vue.js 3 UI Library
82 lines (81 loc) • 2.73 kB
JavaScript
;
var vue = require("vue");
var globalConfig = require("../../_utils/global-config.js");
var is = require("../../_utils/is.js");
var pluginVue_exportHelper = require("../../_virtual/plugin-vue_export-helper.js");
const _sfc_main = vue.defineComponent({
name: "IconCodepen",
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 = globalConfig.getPrefixCls("icon");
const cls = vue.computed(() => [prefixCls, `${prefixCls}-codepen`, { [`${prefixCls}-spin`]: props.spin }]);
const innerStyle = vue.computed(() => {
const styles = {};
if (props.size) {
styles.fontSize = is.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 vue.openBlock(), vue.createElementBlock("svg", {
viewBox: "0 0 48 48",
fill: "none",
xmlns: "http://www.w3.org/2000/svg",
stroke: "currentColor",
class: vue.normalizeClass(_ctx.cls),
style: vue.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] = [
vue.createElementVNode("path", {
d: "M45 15.7v17.1L24.5 44.7c-.3.2-.7.2-1 0l-20-11.5c-.3-.2-.5-.5-.5-.9V15.7c0-.4.2-.7.5-.9l20-11.6c.3-.2.7-.2 1 0l20 11.6c.3.2.5.5.5.9ZM26 9v9.8l5.5 3.2 8.5-4.9L26 9Zm-4 0L8 17.1l8.4 4.9 5.6-3.2V9Zm0 21.2L16.5 27 9 31.4 22 39v-8.8Zm17 1.2L31.4 27 26 30.2V39l13-7.6Zm2-3.4v-6l-5 3 5 3Zm-29-3-5-3v6l5-3Zm8 0 4 2 4-2-4-2-4 2Z",
fill: "currentColor",
stroke: "none"
}, null, -1)
]), 14, _hoisted_1);
}
var _IconCodepen = /* @__PURE__ */ pluginVue_exportHelper(_sfc_main, [["render", _sfc_render]]);
module.exports = _IconCodepen;