refactor(app): 优化代码结构和性能
- 移除 default.vue 中的 keep-alive 组件,以提高页面切换性能 - 在 ItemList 组件中增加对返回数据的数组判断,提升代码健壮性 - 删除未使用的 goodStore 导入,清理冗余代码
This commit is contained in:
parent
77e08232f7
commit
ad9899d716
@ -2,14 +2,10 @@
|
|||||||
<main class="flex flex-col min-h-svh">
|
<main class="flex flex-col min-h-svh">
|
||||||
<AppHeader class="h-[var(--van-nav-bar-height)]" />
|
<AppHeader class="h-[var(--van-nav-bar-height)]" />
|
||||||
<div class="flex-1 flex flex-col">
|
<div class="flex-1 flex flex-col">
|
||||||
<keep-alive>
|
<slot />
|
||||||
<slot />
|
|
||||||
</keep-alive>
|
|
||||||
</div>
|
</div>
|
||||||
<AppFooter />
|
<AppFooter />
|
||||||
</main>
|
</main>
|
||||||
</template>
|
</template>
|
||||||
<script setup >
|
<script setup >
|
||||||
import { goodStore } from "@/stores/goods/index.js";
|
|
||||||
const { fullLive } = goodStore()
|
|
||||||
</script>
|
</script>
|
@ -12,7 +12,9 @@ const finished = ref(false);
|
|||||||
const getArtworkList=async ()=>{
|
const getArtworkList=async ()=>{
|
||||||
const res= await artworkList({auctionUuid: auctionDetail.value.uuid,...pageRef.value})
|
const res= await artworkList({auctionUuid: auctionDetail.value.uuid,...pageRef.value})
|
||||||
if (res.status===0){
|
if (res.status===0){
|
||||||
itemList.value.push(...res.data.data)
|
if (Array.isArray(res.data.data)&&res.data.data?.length>0){
|
||||||
|
itemList.value.push(...res.data.data)
|
||||||
|
}
|
||||||
pageRef.value.itemCount=res.data.count
|
pageRef.value.itemCount=res.data.count
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user