lw-cdp-ui 1.4.43 → 1.4.44
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/lwTour/index.vue +12 -8
- package/dist/lw-cdp-ui.esm.js +306 -303
- package/dist/lw-cdp-ui.umd.js +12 -12
- package/package.json +1 -1
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<el-tour v-model="isOpen" :current="currentStep">
|
|
3
|
-
<el-tour-step
|
|
3
|
+
<el-tour-step
|
|
4
|
+
v-for="(step, index) in formattedSteps"
|
|
5
|
+
:key="index"
|
|
6
|
+
:target="step.target"
|
|
7
|
+
:title="step.title"
|
|
4
8
|
:description="step.description" />
|
|
5
9
|
</el-tour>
|
|
6
10
|
</template>
|
|
@@ -16,7 +20,7 @@ export default {
|
|
|
16
20
|
type: Array,
|
|
17
21
|
required: true,
|
|
18
22
|
validator: (value) => {
|
|
19
|
-
return value.every(step => {
|
|
23
|
+
return value.every((step) => {
|
|
20
24
|
return step.css && step.title && step.description
|
|
21
25
|
})
|
|
22
26
|
}
|
|
@@ -49,7 +53,8 @@ export default {
|
|
|
49
53
|
|
|
50
54
|
// 开始引导
|
|
51
55
|
const startTour = () => {
|
|
52
|
-
|
|
56
|
+
console.log(router)
|
|
57
|
+
const allElementsExist = props.steps.every((step) => {
|
|
53
58
|
return document.querySelector(step.css)
|
|
54
59
|
})
|
|
55
60
|
|
|
@@ -59,7 +64,7 @@ export default {
|
|
|
59
64
|
return
|
|
60
65
|
}
|
|
61
66
|
|
|
62
|
-
formattedSteps.value = props.steps.map(step => {
|
|
67
|
+
formattedSteps.value = props.steps.map((step) => {
|
|
63
68
|
const targetElement = document.querySelector(step.css)
|
|
64
69
|
return {
|
|
65
70
|
target: targetElement || undefined,
|
|
@@ -72,17 +77,16 @@ export default {
|
|
|
72
77
|
isOpen.value = true
|
|
73
78
|
|
|
74
79
|
let LwTour = $tool.data.get('LwTour') || {}
|
|
75
|
-
let { path, meta } = router
|
|
80
|
+
let { path, meta } = router?.currentRoute?.value || {}
|
|
76
81
|
LwTour[`${meta.title}${path}`] = true
|
|
77
82
|
$tool.data.set('LwTour', LwTour)
|
|
78
83
|
}
|
|
79
84
|
|
|
80
|
-
|
|
81
|
-
|
|
82
85
|
// 组件挂载后自动开始引导
|
|
83
86
|
onMounted(() => {
|
|
87
|
+
console.log(router)
|
|
84
88
|
let LwTour = $tool.data.get('LwTour') || {}
|
|
85
|
-
let { path, meta } = router
|
|
89
|
+
let { path, meta } = router?.currentRoute?.value || {}
|
|
86
90
|
if (props.autoStart && !LwTour[`${meta.title}${path}`]) {
|
|
87
91
|
nextTick(() => {
|
|
88
92
|
startTour()
|