-
Notifications
You must be signed in to change notification settings - Fork 309
/
ToolTip.vue
41 lines (37 loc) · 976 Bytes
/
ToolTip.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<template>
<div v-if="!tipConfirmed" style="z-index: 10">
<QBanner class="bg-surface text-display" dense rounded inlineActions>
<template #avatar>
<QIcon name="info" color="primary" />
</template>
<slot></slot>
<template #action>
<QBtn
color="primary"
textColor="display-on-primary"
label="OK"
@click="tipConfirmed = true"
/>
</template>
</QBanner>
</div>
</template>
<script setup lang="ts">
import { computed } from "vue";
import { ConfirmedTips } from "@/type/preload";
import { useStore } from "@/store";
const props = defineProps<{
tipKey: keyof ConfirmedTips;
}>();
const store = useStore();
const tipConfirmed = computed({
get: () => store.state.confirmedTips[props.tipKey],
set: (value) =>
store.actions.SET_CONFIRMED_TIPS({
confirmedTips: {
...store.state.confirmedTips,
[props.tipKey]: value,
},
}),
});
</script>