You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
66 lines
1.3 KiB
66 lines
1.3 KiB
<template>
|
|
<view class="comments">
|
|
<view class="navBox">
|
|
<view class="nav" v-for="(item,index) in navList" :key="index" @click="changeNav(item)" :class="{active: currentNav==item.id}">{{ item.text }}</view>
|
|
</view>
|
|
<view class="card" v-for="(item,index) in list">
|
|
<commentItem :item="item"/>
|
|
</view>
|
|
</view>
|
|
</template>
|
|
|
|
<script>
|
|
// import commentItem from './commentItem'
|
|
export default {
|
|
// components: { commentItem },
|
|
props: ['list'],
|
|
data() {
|
|
return {
|
|
// 0,全部,1,有图,2最新,3有视频
|
|
navList: [
|
|
{text: '全部', id: 0},
|
|
{text: '最新', id: 2},
|
|
{text: '有图', id: 1},
|
|
{text: '有视频', id: 3},
|
|
],
|
|
currentNav: 0,
|
|
}
|
|
},
|
|
methods: {
|
|
changeNav(item) {
|
|
this.currentNav = item.id
|
|
this.$emit('changeNav', item.id)
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style lang="scss" scoped>
|
|
.comments {
|
|
width: 100%;
|
|
padding: 0 28rpx;
|
|
.navBox {
|
|
padding: 32rpx 0 24rpx 0;
|
|
display: flex;
|
|
z-index: 9;
|
|
.nav {
|
|
padding: 6rpx 24rpx;
|
|
height: 50rpx;
|
|
background: #F6F7FA;
|
|
border-radius: 8rpx;
|
|
font-size: 28rpx;
|
|
color: #999;
|
|
margin-right: 20rpx;
|
|
text-align: center;
|
|
&.active {
|
|
color: #fff;
|
|
background: $themC;
|
|
}
|
|
}
|
|
}
|
|
|
|
.card {
|
|
width: 100%;
|
|
}
|
|
}
|
|
</style>
|