@bildvitta/quasar-ui-asteroid 3.13.0-beta.14 → 3.13.0-beta.15
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/package.json
CHANGED
|
@@ -28,11 +28,8 @@
|
|
|
28
28
|
import QasHeaderActions from '../header-actions/QasHeaderActions.vue'
|
|
29
29
|
|
|
30
30
|
import { castArray } from 'lodash-es'
|
|
31
|
-
import { useHistory } from '../../composables'
|
|
32
31
|
import { createMetaMixin } from 'quasar'
|
|
33
32
|
|
|
34
|
-
const { history } = useHistory()
|
|
35
|
-
|
|
36
33
|
export default {
|
|
37
34
|
name: 'QasPageHeader',
|
|
38
35
|
|
|
@@ -94,13 +91,6 @@ export default {
|
|
|
94
91
|
item.route = { name: item.routeName }
|
|
95
92
|
}
|
|
96
93
|
|
|
97
|
-
const historyList = history.list
|
|
98
|
-
|
|
99
|
-
if (historyList.length && item?.route?.name) {
|
|
100
|
-
const previous = historyList.find(history => history.name === item.route.name)
|
|
101
|
-
item.route.query = previous ? previous.query : null
|
|
102
|
-
}
|
|
103
|
-
|
|
104
94
|
return item
|
|
105
95
|
})
|
|
106
96
|
},
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { reactive, computed } from 'vue'
|
|
2
|
-
import { findLastIndex } from 'lodash-es'
|
|
3
2
|
|
|
4
3
|
const history = reactive({ list: [] })
|
|
5
4
|
|
|
@@ -7,17 +6,18 @@ export default function () {
|
|
|
7
6
|
const hasPreviousRoute = computed(() => history.list.length > 1)
|
|
8
7
|
|
|
9
8
|
function getPreviousRoute (currentRoute) {
|
|
10
|
-
const index =
|
|
9
|
+
const index = history.list.findLastIndex(item => item.name === currentRoute.name)
|
|
11
10
|
|
|
12
11
|
if (~index) {
|
|
13
12
|
history.list.splice(index, 1)
|
|
14
13
|
}
|
|
15
14
|
|
|
16
|
-
return history.list
|
|
15
|
+
return history.list.at(-1)
|
|
17
16
|
}
|
|
18
17
|
|
|
19
18
|
function addRoute (route) {
|
|
20
|
-
const
|
|
19
|
+
const lastRoute = history.list?.at(-1)
|
|
20
|
+
const routeExistsInList = lastRoute?.name === route.name
|
|
21
21
|
|
|
22
22
|
if (routeExistsInList) return
|
|
23
23
|
|