UNPKG

@arco-design/web-vue

Version:

Arco Design Vue 2.0: A Vue.js 3 UI Library

78 lines (77 loc) 2.68 kB
"use strict"; 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: "IconTool", 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}-tool`, { [`${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: "M19.994 11.035c3.66-3.659 9.094-4.46 13.531-2.405a.1.1 0 0 1 .028.16l-6.488 6.488a1 1 0 0 0 0 1.414l4.243 4.243a1 1 0 0 0 1.414 0l6.488-6.488a.1.1 0 0 1 .16.028c2.056 4.437 1.254 9.872-2.405 13.53-3.695 3.696-9.2 4.477-13.66 2.347L12.923 40.733a1 1 0 0 1-1.414 0L7.266 36.49a1 1 0 0 1 0-1.414l10.382-10.382c-2.13-4.46-1.349-9.965 2.346-13.66Z" }, null, -1) ]), 14, _hoisted_1); } var _IconTool = /* @__PURE__ */ pluginVue_exportHelper(_sfc_main, [["render", _sfc_render]]); module.exports = _IconTool;