vue-sailor-icons
Version:
Nice open source icons as Vue functional components.
44 lines • 1.58 kB
JavaScript
import _mergeJSXProps from "babel-helper-vue-jsx-merge-props";
export default {
name: 'StarIcon',
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';
}
},
color: {
type: String,
default: '#000'
}
},
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: {
xmlns: "http://www.w3.org/2000/svg",
width: "24",
height: "24",
viewBox: "0 0 24 24"
},
"class": "sailor sailor-star"
}, ctx.data]), [h("path", {
attrs: {
d: "M16.08 20a1.45 1.45 0 0 1-.67-.17L12 18l-3.41 1.83a1.41 1.41 0 0 1-1.73-.33 1.45 1.45 0 0 1-.32-1.17l.66-4-2.79-2.87A1.45 1.45 0 0 1 5.2 9L9 8.45l1.72-3.64a1.38 1.38 0 0 1 2.52 0L15 8.45l3.8.55a1.45 1.45 0 0 1 .79 2.43l-2.79 2.88.66 4a1.45 1.45 0 0 1-.32 1.17 1.39 1.39 0 0 1-1.06.52zM5.59 10.53l3.25 3.26-.75 4.58L12 16.19l3.94 2.17-.78-4.57 3.2-3.27-4.42-.67L12 5.74l-1.94 4.11z",
fill: ctx.props.color
}
}), h("polygon", {
attrs: {
points: "9.55 9.92 9.54 8.38 9.55 8.38 9.55 9.92",
fill: ctx.props.color
}
})]);
}
};