-
Notifications
You must be signed in to change notification settings - Fork 53
Expand file tree
/
Copy pathTutorialTooltip.vue
More file actions
81 lines (71 loc) · 1.8 KB
/
Copy pathTutorialTooltip.vue
File metadata and controls
81 lines (71 loc) · 1.8 KB
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
<template>
<q-menu
ref="menu"
:model-value="true"
:anchor="
(basis === 'left' ? `center ${flippedPos}` : `${pos} middle`) as any
"
:self="(basis === 'left' ? `center ${pos}` : `${flippedPos} middle`) as any"
:offset="[basis === 'left' ? 8 : 0, basis === 'top' ? 8 : 0]"
style="position: relative; overflow: visible"
persistent
no-focus
no-refocus
>
<div
style="
padding: 8px;
background-color: #5e00d6;
border-radius: 4px;
overflow: hidden;
white-space: nowrap;
"
>
<slot></slot>
<Gap style="height: 8px" />
<div style="display: flex">
<a
v-if="internals.pages.react.tutorialStep > 1"
href="javascript:undefined"
style="color: aqua; font-size: 12px"
@click="
internals.pages.react.tutorialStep = Math.max(
1,
internals.pages.react.tutorialStep - 1,
)
"
>
Previous
</a>
<Gap style="flex: 1" />
<a
href="javascript:undefined"
style="color: aqua; font-size: 12px"
@click="internals.pages.react.tutorialStep++"
>
Next
</a>
</div>
</div>
<Indicator
:pos="flippedPos"
color="#5e00d6"
/>
</q-menu>
</template>
<script setup lang="ts">
import { QMenu } from 'quasar';
import type { CSSPosition } from 'src/code/utils/position';
import { flipPos, posToBasis } from 'src/code/utils/position';
const props = defineProps<{
pos: CSSPosition;
}>();
const basis = computed(() => posToBasis(props.pos));
const flippedPos = computed(() => flipPos(props.pos));
const menu = ref<QMenu>();
defineExpose({
updatePosition() {
menu.value?.updatePosition();
},
});
</script>