File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -31,22 +31,27 @@ export default defineComponent({
31
31
immediate: true
32
32
})
33
33
34
+ let initDefaultAppId = false
35
+
34
36
watch (apps , () => {
35
- if (! currentApp .value && apps .value .length ) {
37
+ if (( ! currentApp .value || ( SharedData . pageConfig ?. defaultSelectedAppId && ! initDefaultAppId )) && apps .value .length ) {
36
38
let targetId: string
37
39
if (SharedData .pageConfig ?.defaultSelectedAppId ) {
38
40
targetId = SharedData .pageConfig .defaultSelectedAppId
41
+ initDefaultAppId = true
39
42
} else if (currentAppId .value !== apps .value [0 ].id ) {
40
43
targetId = apps .value [0 ].id
41
44
}
42
45
if (targetId ) {
43
46
router .push ({
44
47
params: {
45
- appId: apps . value [ 0 ]. id . toString ()
48
+ appId: targetId
46
49
}
47
50
})
48
51
}
49
52
}
53
+ }, {
54
+ immediate: true
50
55
})
51
56
52
57
const { orientation } = useOrientation ()
You can’t perform that action at this time.
0 commit comments