v-simple-icons
Version:
Simply beautiful open source icons as Vue functional components.
32 lines • 1.25 kB
JavaScript
import _mergeJSXProps from "babel-helper-vue-jsx-merge-props";
export default {
name: 'StackExchangeIcon',
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", ["Stack Exchange icon"]), h("path", {
attrs: {
d: "M21.728 15.577v1.036c0 1.754-1.395 3.177-3.1 3.177h-.904L13.645 24v-4.21H5.371c-1.704 0-3.099-1.423-3.099-3.181v-1.032h19.456zM2.275 10.463h19.323v3.979H2.275v-3.979zm0-5.141h19.323v3.979H2.275V5.322zM18.575 0c1.681 0 3.023 1.42 3.023 3.178v1.034H2.275V3.178C2.275 1.422 3.67 0 5.375 0h13.2z"
}
})]);
}
};