Skip to content

Commit 9cc46ec

Browse files
committed
update: add a style when the home page list has no data
1 parent 67d0fc5 commit 9cc46ec

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

src/pages/index/index.wxml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,14 @@
1212
<text>{{item.text}}</text>
1313
</view>
1414
</view>
15-
<view class="topic-list-wrap">
16-
<topic-list data="{{aTopicList}}"></topic-list>
15+
<view class="topic-list-wrap">
16+
<block wx:if="{{aTopicList.length}}">
17+
<topic-list data="{{aTopicList}}"></topic-list>
18+
</block>
19+
<block wx:else>
20+
<view class="topic-list-no-data vh-parent color-grey">
21+
<text class="vh">暂无数据~</text>
22+
</view>
23+
</block>
1724
</view>
1825
</view>

src/pages/index/index.wxss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,8 @@
2626
}
2727
.topic-list-wrap {
2828
padding: 20rpx
29+
}
30+
.topic-list-no-data {
31+
height: calc(100vh - 150rpx);
32+
font-size: 28rpx;
2933
}

0 commit comments

Comments
 (0)