-
Notifications
You must be signed in to change notification settings - Fork 138
/
Outline.vue
57 lines (51 loc) 路 1.19 KB
/
Outline.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<template>
<div>
<IxButton @click="beginTour">Begin</IxButton>
<IxDivider />
<IxSpace>
<div ref="firstBtnRef">
<IxButton>Step1</IxButton>
</div>
<div ref="secondBtnRef">
<IxButton>Step2</IxButton>
</div>
<div ref="thirdBtnRef">
<IxButton>Step3</IxButton>
</div>
</IxSpace>
</div>
<IxTour v-model:visible="tourVisible" :steps="steps" :gap="{ outline: 2 }"></IxTour>
</template>
<script setup lang="ts">
import type { TourStep } from '@idux/components/tour'
import { ref } from 'vue'
const tourVisible = ref(false)
const steps = ref<TourStep[]>([
{
title: 'Step1',
description: 'this is description...',
target: () => firstBtnRef.value,
},
{
title: 'Step2',
description: 'this is description...',
target: () => secondBtnRef.value,
},
{
title: 'Step3',
description: 'this is description...',
target: () => thirdBtnRef.value,
},
])
const beginTour = () => {
tourVisible.value = true
}
const firstBtnRef = ref<HTMLElement>()
const secondBtnRef = ref<HTMLElement>()
const thirdBtnRef = ref<HTMLElement>()
</script>
<style lang="less">
.demo-tour-custom-mask-cls {
opacity: 0.4;
}
</style>