2019-10-28 01:54:37 +00:00
|
|
|
<template>
|
|
|
|
<div
|
2019-11-04 04:47:37 +00:00
|
|
|
:title="title"
|
2019-10-28 01:54:37 +00:00
|
|
|
:class="{ active }"
|
|
|
|
class="icon"
|
|
|
|
v-html="svg"
|
|
|
|
/>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
export default {
|
|
|
|
props: {
|
|
|
|
icon: {
|
|
|
|
type: String,
|
|
|
|
default: null,
|
|
|
|
},
|
2019-11-04 04:47:37 +00:00
|
|
|
title: {
|
2019-10-28 01:54:37 +00:00
|
|
|
type: String,
|
|
|
|
default: null,
|
|
|
|
},
|
|
|
|
active: {
|
|
|
|
type: Boolean,
|
|
|
|
default: false,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
svg: null,
|
|
|
|
};
|
|
|
|
},
|
|
|
|
beforeMount() {
|
2020-05-13 18:27:06 +00:00
|
|
|
this.svg = require(`../../img/icons/${this.icon}.svg`).default;
|
2019-10-28 01:54:37 +00:00
|
|
|
},
|
|
|
|
};
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss">
|
|
|
|
@import '../../css/theme';
|
|
|
|
|
|
|
|
.icon {
|
|
|
|
fill: $text;
|
|
|
|
display: inline-block;
|
|
|
|
flex-shrink: 0;
|
|
|
|
width: 1rem;
|
|
|
|
height: 1rem;
|
|
|
|
|
|
|
|
svg {
|
|
|
|
width: 100%;
|
|
|
|
height: 100%;
|
|
|
|
}
|
|
|
|
|
|
|
|
&.active {
|
|
|
|
fill: $shadow;
|
|
|
|
|
|
|
|
&:hover {
|
|
|
|
fill: $text;
|
|
|
|
cursor: pointer;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|