🎈 perf(尝试解决正式环境首次进入白屏问题):
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user