<template>
	<view class="news-recommend">
		<view v-if="recommendType === 'home'" class="news-tab">
			<u-tabs :active.sync="newsType" :tabs="tabs" tab-style="default" @change="tabChange"/>
		</view>
		<view class="news-list">
			<template v-for="(item, index) in newsList">
				<news-item :item="item" :key="index" :type="newsType" />
			</template>
		</view>
	</view>
</template>

<script>
	import UTabs from '@/components/common/u-tabs'
	import NewsItem from '@/pages/news/components/news-item.vue'
	
	export default {
		components: {
			UTabs,
			NewsItem
		},
		props: {
			// 特定的展商ID
			exhibitorId: Number,
			recommendType: {
				type: String,
				default: 'home'
			}
		},
		data() {
			return {
				newsType: 'exhibition',
				tabs: [{
					label: '展会新闻',
					value: 'exhibition'
				}, {
					label: '展商新闻',
					value: 'exhibitor'
				}],
				newsList: [{}, {}, {}]
			}
		},
		created() {
			if (recommendType === 'detail') {
				this.newsType = 'exhibitor'
			}
		},
		methods: {
			tabChange() {
				
			}
		}
	}
</script>
<style lang="scss" scoped>
	.news-list{
		display: grid;
		grid-template-columns: 1fr;
		grid-row-gap: 18rpx;
		margin-top: 28rpx;
	}
</style>