Add icon component

This commit is contained in:
Tamius Han 2020-12-02 22:39:43 +01:00
parent cda4b81554
commit a91ed7368f
2 changed files with 28 additions and 1 deletions

View File

@ -0,0 +1,25 @@
<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>

View File

@ -34,7 +34,7 @@
</div>
<div class="flex flex-row flex-end w100">
<div v-if="!showTextMode" class="button" @click="showTextMode = true">
Paste config ...
<Icon icon="clipboard-plus" style="font-size: 2em"></Icon>&nbsp; Paste config ...
</div>
<div v-else class="button" @click="showTextMode = false">
Back
@ -164,10 +164,12 @@ import Logger from '../ext/lib/Logger';
import Comms from '../ext/lib/comms/Comms';
import IO from '../common/js/IO';
import JsonObject from '../common/components/JsonEditor/JsonObject';
import Icon from '../common/components/Icon';
export default {
components: {
JsonObject,
Icon,
},
data() {
return {