lw-cdp-ui 1.4.44 → 1.4.46
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 +25 -12
- package/dist/lw-cdp-ui.esm.js +337 -310
- package/dist/lw-cdp-ui.umd.js +7 -3
- package/package.json +1 -1
|
@@ -53,14 +53,23 @@ export default {
|
|
|
53
53
|
|
|
54
54
|
// 开始引导
|
|
55
55
|
const startTour = () => {
|
|
56
|
-
|
|
56
|
+
// 如果 router 未初始化,延迟执行
|
|
57
|
+
if (!router) {
|
|
58
|
+
setTimeout(() => {
|
|
59
|
+
startTour()
|
|
60
|
+
}, 100)
|
|
61
|
+
return
|
|
62
|
+
}
|
|
63
|
+
|
|
57
64
|
const allElementsExist = props.steps.every((step) => {
|
|
58
65
|
return document.querySelector(step.css)
|
|
59
66
|
})
|
|
60
67
|
|
|
61
68
|
if (!allElementsExist) {
|
|
62
69
|
console.warn('元素未加载完成')
|
|
63
|
-
|
|
70
|
+
setTimeout(() => {
|
|
71
|
+
startTour()
|
|
72
|
+
}, 100)
|
|
64
73
|
return
|
|
65
74
|
}
|
|
66
75
|
|
|
@@ -70,27 +79,31 @@ export default {
|
|
|
70
79
|
target: targetElement || undefined,
|
|
71
80
|
title: step.title,
|
|
72
81
|
description: step.description,
|
|
73
|
-
// 可以添加更多el-tour支持的配置项
|
|
74
82
|
placement: 'bottom'
|
|
75
83
|
}
|
|
76
84
|
})
|
|
77
85
|
isOpen.value = true
|
|
78
86
|
|
|
79
87
|
let LwTour = $tool.data.get('LwTour') || {}
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
88
|
+
const currentRoute = router?.currentRoute?.value
|
|
89
|
+
if (currentRoute) {
|
|
90
|
+
const { path, meta } = currentRoute
|
|
91
|
+
LwTour[`${meta?.title || ''}${path}`] = true
|
|
92
|
+
$tool.data.set('LwTour', LwTour)
|
|
93
|
+
}
|
|
83
94
|
}
|
|
84
95
|
|
|
85
96
|
// 组件挂载后自动开始引导
|
|
86
97
|
onMounted(() => {
|
|
87
|
-
console.log(router)
|
|
88
98
|
let LwTour = $tool.data.get('LwTour') || {}
|
|
89
|
-
|
|
90
|
-
if (
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
99
|
+
const currentRoute = router?.currentRoute?.value
|
|
100
|
+
if (currentRoute) {
|
|
101
|
+
const { path, meta } = currentRoute
|
|
102
|
+
if (!LwTour[`${meta?.title || ''}${path}`]) {
|
|
103
|
+
nextTick(() => {
|
|
104
|
+
startTour()
|
|
105
|
+
})
|
|
106
|
+
}
|
|
94
107
|
}
|
|
95
108
|
$bus.$emit(`lwTourOpen`, true)
|
|
96
109
|
})
|