🎈 perf(尝试解决正式环境首次进入白屏问题):

This commit is contained in:
2022-12-06 14:33:39 +08:00
parent 3e7b70c190
commit ac56bfbd6d
3 changed files with 17 additions and 10 deletions
+3 -3
View File
@@ -61,7 +61,7 @@ const SideBar = ({
const getClassData = async(id) => {
const res = await fetchData({ id })
if (res.success) {
if (res.data?.list.length > 0) {
if (res.data?.list?.length > 0) {
res.data.list = [{ id: -1, name: '全部' }, ...res.data.list]
}
setClassList(() => res.data?.list)
@@ -130,8 +130,8 @@ const SideBar = ({
)
})}
</ScrollView>
<View className={styles.sideBar_con} style={{ paddingTop: classList.length > 0 ? '90rpx' : '20rpx' }}>
{classList.length > 0 && (
<View className={styles.sideBar_con} style={{ paddingTop: classList?.length > 0 ? '90rpx' : '20rpx' }}>
{classList?.length > 0 && (
<View className={styles.product_class} style={{ height: openClass ? '100%' : '' }}>
<ProductClass list={classList} open={openClass} onOpenClick={val => setOpenClass(val)} onSelect={getSelectClass} defaultSelectId={classId} />
</View>