增强异步体验

This commit is contained in:
ZtRXR 2023-09-03 12:23:52 +08:00
parent 5f22be2844
commit 562c9dbca6

View File

@ -1,12 +1,18 @@
<script setup lang="ts"> <script setup lang="ts">
const getWebArr:string[] = await $fetch("https://data.zziyu.cn/hot/webs") const getWebArr = reactive<string[]>([])
const loading = ref(true)
$fetch("https://data.zziyu.cn/hot/webs").then((rawData)=>{
const data = rawData as unknown as string[]
data.map(m=>getWebArr.push(m))
loading.value=false
})
</script> </script>
<template> <template>
<Title>数据收集</Title> <Title>数据收集</Title>
<div style="display: flex;align-items: center;justify-content: center;flex-direction: column"> <div v-loading="loading" style="min-height: 100px;display: flex;align-items: center;justify-content: center;flex-direction: column">
<DataTimesTop v-for="(item,index) in getWebArr" :fromWeb="item" :limit="10" :hours="1" :key="index"></DataTimesTop> <DataTimesTop v-for="(item,index) in getWebArr" :fromWeb="item" :limit="10" :hours="1" :key="index"></DataTimesTop>
</div> </div>
</template> </template>