Files
mixtape/zero.Backoffice.UI/app/components/ui-icon.vue
T

68 lines
1.2 KiB
Vue
Raw Normal View History

2020-11-20 15:17:41 +01:00
<template>
<svg class="ui-icon" :width="size" :height="size" :stroke-width="stroke" :data-symbol="symbolName" :class="classes">
2021-03-16 13:57:52 +01:00
<use v-show="!isFlag" v-bind="{ 'xlink:href': href }" />
</svg>
2020-11-20 15:17:41 +01:00
</template>
2021-12-07 01:11:18 +01:00
<script lang="ts">
2020-11-20 15:17:41 +01:00
export default {
props: {
symbol: {
2020-11-20 15:17:41 +01:00
type: String,
2021-02-04 14:00:09 +01:00
default: null,
required: true
},
2021-03-16 13:57:52 +01:00
file: {
type: String,
default: null
},
size: {
type: Number,
default: 17
},
2021-02-05 13:00:42 +01:00
stroke: {
type: Number,
default: 2
2020-11-20 15:17:41 +01:00
}
2021-01-20 15:54:12 +01:00
},
2021-03-16 13:57:52 +01:00
2021-01-20 15:54:12 +01:00
computed: {
symbolName()
{
2022-01-04 17:56:34 +01:00
return this.symbol && this.symbol.split(' ')[0].trim();
},
classes()
{
return this.symbol ? this.symbol.split(' ').slice(1) : [];
},
2021-01-20 15:54:12 +01:00
isFlag()
{
return this.symbol && this.symbol.indexOf('flag') === 0;
2021-03-16 13:57:52 +01:00
},
href()
{
2022-01-04 17:56:34 +01:00
return (this.file || '') + '#' + this.symbolName;
2021-01-20 15:54:12 +01:00
}
2020-11-20 15:17:41 +01:00
}
}
</script>
<style lang="scss">
.ui-icon
{
stroke: currentColor;
stroke-linecap: round;
stroke-linejoin: round;
2021-08-25 10:38:13 +02:00
//fill: var(--color-bg-shade-3);
fill: none;
}
2021-02-05 13:00:42 +01:00
.ui-icon[data-symbol="fth-waffle"]
{
stroke: none;
fill: currentColor;
}
</style>