adrema/resources/js/components/Sprite.js

18 lines
468 B
JavaScript
Raw Normal View History

2021-04-11 00:57:47 +02:00
export default {
props: {
src: { required: true, type: String }
},
render: function(createElement) {
var attr = this.$attrs.class ? this.$attrs.class : '';
return createElement('svg', {
class: attr + ' fill-current'
}, [
createElement('use', {
'attrs': {
'xlink:href': `/img/sprite.svg#${this.$props.src}`
}
}, '')
] )
}
};