add loading overlay on query
This commit is contained in:
+2
-2
@@ -10,9 +10,9 @@
|
|||||||
<router-view />
|
<router-view />
|
||||||
</main>
|
</main>
|
||||||
|
|
||||||
<footer>
|
<!-- <footer>
|
||||||
<p>footer</p>
|
<p>footer</p>
|
||||||
</footer>
|
</footer> -->
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
|
<b-overlay :show="loading" rounded="sm" class="h-100">
|
||||||
<div class="d-flex flex-column h-100 px-4 py-3">
|
<div class="d-flex flex-column h-100 px-4 py-3">
|
||||||
<div id="maps">
|
<div id="maps">
|
||||||
<div>
|
<div>
|
||||||
@@ -47,6 +48,7 @@
|
|||||||
</b-form-checkbox>
|
</b-form-checkbox>
|
||||||
</b-form>
|
</b-form>
|
||||||
</div>
|
</div>
|
||||||
|
</b-overlay>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
@@ -65,6 +67,7 @@ export default {
|
|||||||
|
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
|
loading: false,
|
||||||
textId: undefined,
|
textId: undefined,
|
||||||
showId: true,
|
showId: true,
|
||||||
depth: 3,
|
depth: 3,
|
||||||
@@ -82,15 +85,18 @@ export default {
|
|||||||
query () {
|
query () {
|
||||||
const { textId: id, depth } = this
|
const { textId: id, depth } = this
|
||||||
this.data = null
|
this.data = null
|
||||||
|
this.loading = true
|
||||||
this.$store.dispatch('GET_TREE_WITH_DEPTH', { id, depth }).then((data) => {
|
this.$store.dispatch('GET_TREE_WITH_DEPTH', { id, depth }).then((data) => {
|
||||||
this.mapSingle = toSingleManyData(data)
|
this.mapSingle = toSingleManyData(data)
|
||||||
this.mapMany = toManyManyData(data)
|
this.mapMany = toManyManyData(data)
|
||||||
this.data = data
|
this.data = data
|
||||||
|
this.loading = false
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
created () {
|
created () {
|
||||||
|
this.loading = true
|
||||||
this.$store.dispatch('GET_TEXTS_DEPART').then(textsDepart => {
|
this.$store.dispatch('GET_TEXTS_DEPART').then(textsDepart => {
|
||||||
this.textId = textsDepart[0].id
|
this.textId = textsDepart[0].id
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user