ultrawidify/src/common/components/Icon.vue

30 lines
532 B
Vue
Raw Normal View History

2020-12-02 22:39:43 +01:00
<template>
2020-12-03 00:32:17 +01:00
<svg class="bi icon" width="1em" height="1em" fill="currentColor">
2020-12-02 22:39:43 +01:00
<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>
2020-12-03 00:32:17 +01:00
.icon {
margin-left: 1em;
margin-right: 1em;
}
2020-12-02 22:39:43 +01:00
</style>