ultrawidify/src/common/components/Icon.vue

26 lines
476 B
Vue
Raw Normal View History

2020-12-02 22:39:43 +01:00
<template>
<svg class="bi" width="1em" height="1em" fill="currentColor">
<use :xlink:href=" '' + iconHref" />
</svg>
</template>
<script>
export default {
props: {
icon: String,
},
data() {
return {
bootstrapIconsBasePath: (browser ?? chrome).runtime.getURL('/res/icons/bootstrap-icons.svg'),
iconHref: '',
};
},
created() {
this.iconHref = `${this.bootstrapIconsBasePath}#${this.icon}`;
}
}
</script>
<style scoped>
</style>