v-simple-icons
Version:
Simply beautiful open source icons as Vue functional components.
32 lines • 1.37 kB
JavaScript
import _mergeJSXProps from "babel-helper-vue-jsx-merge-props";
export default {
name: 'TeslaIcon',
props: {
size: {
type: String,
default: '24',
validator: function validator(s) {
return !isNaN(s) || s.length >= 2 && !isNaN(s.slice(0, s.length - 1)) && s.slice(-1) === 'x';
}
}
},
functional: true,
render: function render(h, ctx) {
var size = ctx.props.size.slice(-1) === 'x' ? ctx.props.size.slice(0, ctx.props.size.length - 1) + 'em' : parseInt(ctx.props.size) + 'px';
var attrs = ctx.data.attrs || {};
attrs.width = attrs.width || size;
attrs.height = attrs.height || size;
ctx.data.attrs = attrs;
return h("svg", _mergeJSXProps([{
attrs: {
role: "img",
viewBox: "0 0 24 24",
xmlns: "http://www.w3.org/2000/svg"
}
}, ctx.data]), [h("title", ["Tesla icon"]), h("path", {
attrs: {
d: "M12 5.362l2.475-3.026s4.245.09 8.471 2.054c-1.082 1.636-3.231 2.438-3.231 2.438-.146-1.439-1.154-1.79-4.354-1.79L12 24 8.619 5.034c-3.18 0-4.188.354-4.335 1.792 0 0-2.146-.795-3.229-2.43C5.28 2.431 9.525 2.34 9.525 2.34L12 5.362l-.004.002H12v-.002zm0-3.899c3.415-.03 7.326.528 11.328 2.28.535-.968.672-1.395.672-1.395C19.625.612 15.528.015 12 0 8.472.015 4.375.61 0 2.349c0 0 .195.525.672 1.396C4.674 1.989 8.585 1.435 12 1.46v.003z"
}
})]);
}
};