v-simple-icons
Version:
Simply beautiful open source icons as Vue functional components.
32 lines • 1.27 kB
JavaScript
import _mergeJSXProps from "babel-helper-vue-jsx-merge-props";
export default {
name: 'TedIcon',
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", ["TED icon"]), h("path", {
attrs: {
d: "M2.431 9.886H0V7.665h7.53v2.221H5.1v6.45H2.431v-6.45zm5.514-2.221h7.31v2.221h-4.638v1.083h4.638v2.063h-4.638v1.08h4.638v2.225h-7.31V7.665zm10.43 6.451h1.046c1.664 0 1.907-1.352 1.907-2.166 0-.545-.179-2.063-2.115-2.063h-.854v4.23l.016-.001zm-2.67-6.451h4.384C22.98 7.665 24 9.8 24 11.985c0 2.66-1.409 4.351-4.434 4.351h-3.861V7.663v.002z"
}
})]);
}
};