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: 'BuddyIcon',
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", ["Buddy icon"]), h("path", {
attrs: {
d: "M21.7 5.307L12.947.253a1.892 1.892 0 0 0-1.891 0L2.3 5.306a1.892 1.892 0 0 0-.945 1.638v10.109c0 .675.36 1.3.945 1.637l8.756 5.056a1.892 1.892 0 0 0 1.89 0l8.756-5.055c.585-.338.945-.962.945-1.638V6.945c0-.675-.36-1.3-.945-1.638zm-7.45 7.752l-3.804 3.804-1.351-1.351 3.804-3.805-3.804-3.805 1.351-1.35 3.804 3.804 1.351 1.351-1.35 1.352z"
}
})]);
}
};