# 封装热门分类组件
<template>
<view class="topic-nav">
<view class="u-f-ac u-f-jsb">
<view>热门分类</view>
<view class="u-f-ac">更多 <view class="icon iconfont icon-jinru"></view>
</view>
</view>
<view class="u-f-ac tag-list">
<block v-for="(item, index) in nav" :key="index">
<view>{{item.name}}</view>
</block>
</view>
</view>
</template>
<script>
export default {
props: {
nav: Array
}
}
</script>
<style lang="less" scoped>
// 热门分类
.topic-nav {
border-top: 1rpx solid #eee;
border-bottom: 1rpx solid #eee;
padding: 20rpx;
view {
&:first-child {
margin-bottom: 10rpx;
color: #333;
font-size: 32rpx;
}
}
.tag-list {
view {
flex: 1;
color: #9e9e9e;
background-color: #eee;
border-radius: 10rpx;
margin: 0 10rpx;
text-align: center;
}
}
}
</style>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50