v-simple-icons
Version:
Simply beautiful open source icons as Vue functional components.
32 lines • 1.29 kB
JavaScript
import _mergeJSXProps from "babel-helper-vue-jsx-merge-props";
export default {
name: 'DrupalIcon',
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", ["Drupal icon"]), h("path", {
attrs: {
d: "M20.45 3.552C18.258 1.257 15.233.006 12 .006 5.431.006.007 5.428.007 12S5.43 23.994 12 23.994 23.995 18.572 23.995 12c0-3.233-1.251-6.258-3.546-8.448zM12 19.822c-3.65 0-6.57-2.92-6.57-6.57 0-3.025 2.085-5.111 3.858-6.884 1.252-1.252 2.4-2.4 2.712-3.755.313 1.252 1.46 2.399 2.712 3.65 1.773 1.774 3.859 3.86 3.859 6.884 0 3.65-2.92 6.571-6.571 6.675z"
}
})]);
}
};