Skip to content

Commit 199b71e

Browse files
committed
Try to fix v2
1 parent 5fc526c commit 199b71e

File tree

1 file changed

+40
-15
lines changed

1 file changed

+40
-15
lines changed

components/modules/stats/tabs/RollupsTab.vue

Lines changed: 40 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,37 +13,62 @@ import { getSeriesByGroupAndType } from "@/services/constants/stats.js"
1313
import { fetchRollups } from "@/services/api/rollup.js"
1414
1515
const isLoading = ref(false)
16-
const series = computed(() => getSeriesByGroupAndType('Rollups'))
16+
const series = ref()
17+
// const series = computed(() => getSeriesByGroupAndType('Rollups'))
1718
1819
const getRollups = async () => {
1920
isLoading.value = true
2021
2122
// const data = await fetchRollups({
2223
// limit: 100,
2324
// })
25+
series.value = getSeriesByGroupAndType('Rollups')
2426
2527
fetchRollups({ limit: 100 })
26-
.then((res) => {
27-
console.log('isLoading.value then', isLoading.value);
28-
console.log('series.value.data then1', series.value.data);
28+
.then((res) => {
29+
console.log('isLoading.value then', isLoading.value);
30+
console.log('series.value.data then1', series.value.data);
31+
32+
series.value.data = res
33+
console.log('series.value.data then2', series.value.data);
34+
})
35+
.finally(() => {
36+
console.log('isLoading.value finally1', isLoading.value);
37+
isLoading.value = false
38+
console.log('isLoading.value finally2', isLoading.value);
39+
})
40+
41+
// fetchRollups({ limit: 100 })
42+
// .then((res) => {
43+
// console.log('isLoading.value then', isLoading.value);
44+
// console.log('series.value.data then1', series.value.data);
2945
30-
series.value.data = res
31-
console.log('series.value.data then2', series.value.data);
32-
} )
33-
.finally(() => {
34-
console.log('isLoading.value finally1', isLoading.value);
35-
isLoading.value = false
36-
console.log('isLoading.value finally2', isLoading.value);
37-
})
46+
// series.value.data = res
47+
// console.log('series.value.data then2', series.value.data);
48+
// } )
49+
// .finally(() => {
50+
// console.log('isLoading.value finally1', isLoading.value);
51+
// isLoading.value = false
52+
// console.log('isLoading.value finally2', isLoading.value);
53+
// })
3854
3955
// series.value.data = data
4056
4157
// isLoading.value = false
4258
}
4359
44-
onMounted(async () => {
45-
await getRollups()
46-
})
60+
// onMounted(async () => {
61+
// await getRollups()
62+
// })
63+
64+
// watch(
65+
// () => series.value,
66+
// async () => {
67+
// await getRollups()
68+
// }
69+
// )
70+
71+
await getRollups()
4772
</script>
4873

4974
<template>

0 commit comments

Comments
 (0)