This commit is contained in:
2020-10-30 23:15:24 +00:00
parent d4a6bb109e
commit 6534e2c107
2 changed files with 37 additions and 10 deletions

View File

@@ -3,23 +3,38 @@
<!-- todo: need type icon and badge with count options in title bar (badge is icon?) -->
<slot name="dash-title">
<v-toolbar flat dense>
<v-btn text icon to="/home-notifications" data-cy="notification">
<template v-if="showCount">
<v-badge :value="23 > 0">
<template v-if="hasUrl">
<v-btn text icon :to="moreUrl">
<template v-if="showCount && count > 0">
<v-badge overlap>
<template v-slot:badge>
{{ count }}
</template>
<v-icon>{{ icon }}</v-icon>
</v-badge>
</template>
<template v-else>
<v-icon>{{ icon }}</v-icon>
</template>
</v-btn>
</template>
<template v-else>
<template v-if="showCount && count > 0">
<v-badge overlap class="mr-4">
<template v-slot:badge>
23
{{ count }}
</template>
<v-icon>$ayiSplotch</v-icon>
<v-icon>{{ icon }}</v-icon>
</v-badge>
</template>
<template v-else> <v-icon>$ayiSplotch</v-icon> </template>
</v-btn>
<template v-else>
<v-icon class="mr-4">{{ icon }}</v-icon>
</template>
</template>
<v-toolbar-title> {{ title }}</v-toolbar-title>
<v-spacer></v-spacer>
<v-spacer></v-spacer>
<!-- <v-btn icon>
<v-icon>mdi-heart</v-icon>
</v-btn> -->
@@ -105,7 +120,15 @@ export default {
},
title: String,
moreUrl: String,
showCount: Boolean
showCount: Boolean,
count: { type: Number, default: 0 },
updateFrequency: { type: Number, default: 60000 },
icon: String
},
computed: {
hasUrl: function() {
return this.moreUrl && this.moreUrl != "";
}
},
methods: {}
};

View File

@@ -52,6 +52,10 @@
<gz-dash
:title="item.title"
:id="item.id"
:showCount="true"
:count="3"
moreUrl="/home-dashboard"
icon="$ayiRobot"
v-on:dash-remove="dashRemove"
v-on:dash-move-start="dashMoveStart"
v-on:dash-move-back="dashMoveBack"