itemicon supports hidden status

This commit is contained in:
MaysWind
2023-07-09 00:43:28 +08:00
parent dc7c0e61fd
commit d013f67c70
+21 -2
View File
@@ -1,7 +1,14 @@
<template> <template>
<i class="item-icon" :class="icon" :style="style"> <i class="item-icon" :class="icon" :style="style" v-if="!hiddenStatus">
<slot></slot> <slot></slot>
</i> </i>
<v-badge class="right-bottom-icon" color="secondary"
location="bottom right" offset-y="2" :icon="icons.hide"
v-if="hiddenStatus">
<i class="item-icon" :class="icon" :style="style">
<slot></slot>
</i>
</v-badge>
</template> </template>
<script> <script>
@@ -9,14 +16,26 @@ import iconConstatns from '@/consts/icon.js';
import colorConstatns from '@/consts/color.js'; import colorConstatns from '@/consts/color.js';
import { isNumber } from '@/lib/common.js'; import { isNumber } from '@/lib/common.js';
import {
mdiEyeOffOutline
} from '@mdi/js';
export default { export default {
props: [ props: [
'iconType', 'iconType',
'iconId', 'iconId',
'color', 'color',
'defaultColor', 'defaultColor',
'additionalColorAttr' 'additionalColorAttr',
'hiddenStatus'
], ],
data() {
return {
icons: {
hide: mdiEyeOffOutline
}
}
},
computed: { computed: {
icon() { icon() {
if (this.iconType === 'account') { if (this.iconType === 'account') {