v-simple-icons
Version:
Simply beautiful open source icons as Vue functional components.
32 lines • 1.28 kB
JavaScript
import _mergeJSXProps from "babel-helper-vue-jsx-merge-props";
export default {
name: 'CodeClimateIcon',
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",
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 24 24"
}
}, ctx.data]), [h("title", ["Code Climate icon"]), h("path", {
attrs: {
d: "M 16.046875 5.039062 L 24 12.992188 L 21.292969 15.703125 L 16.046875 10.457031 L 14.203125 12.308594 L 11.488281 9.597656 Z M 10.652344 10.4375 L 13.359375 13.152344 L 15.90625 15.691406 L 13.191406 18.398438 L 7.953125 13.160156 L 3.777344 17.335938 L 2.707031 18.398438 L 0 15.691406 L 7.953125 7.738281 Z M 10.652344 10.4375"
}
})]);
}
};