1
1
<script setup lang="ts">
2
2
import { useStore } from ' vuex'
3
- import { computed , onMounted , ref , watch } from ' vue'
3
+ import { computed , onMounted , Ref , ref , watch } from ' vue'
4
4
import { key } from ' ./store'
5
5
import { useRoute , useRouter } from ' vue-router'
6
6
import dataService from " ./services/DataService" ;
@@ -21,7 +21,10 @@ console.log("route " + route.fullPath + " " + route.path + " " + route.redirecte
21
21
console .log (route )
22
22
console .log (router .currentRoute .value )
23
23
24
+ const initialLoad : Ref <boolean > = ref (false )
25
+
24
26
store .dispatch (' setupStatus' )
27
+ initialLoad .value = true
25
28
store .dispatch (' getUser' )
26
29
.then (async () => {
27
30
console .log (" then" )
@@ -31,13 +34,15 @@ store.dispatch('getUser')
31
34
await router .push (store .state .route )
32
35
}
33
36
console .log (" ok nav" )
37
+ initialLoad .value = false
34
38
store .dispatch (' getServerSettings' )
35
39
// } catch(e) {
36
40
// console.log("error nav")
37
41
// console.log(e)
38
42
// }
39
43
})
40
44
.catch (() => {
45
+ initialLoad .value = false
41
46
console .log (" catch in App" )
42
47
router .push ({ name: ' login' }).then (() => { console .log (" ok nav" ) }).catch (() => { console .log (" error nav" ) })
43
48
})
@@ -406,6 +411,16 @@ watch(() => route.name, (newVal, oldVal) => {
406
411
</div >
407
412
</label >
408
413
</label >
414
+ <o-loading
415
+ v-model:active =" initialLoad"
416
+ :full-page =" true"
417
+ :can-cancel =" false"
418
+ >
419
+ <!-- loader from https://loading.io/css/ -->
420
+ <div class =" lds-facebook" >
421
+ <div /><div /><div />
422
+ </div >
423
+ </o-loading >
409
424
</section >
410
425
</template >
411
426
0 commit comments