<template>
	<div class="news">
		<jm-box :navList='navList' @navListC='navListC'>
		</jm-box>
	</div>
</template>

<script> 
import { getArticList,details,getList } from '@/request/api.js'

	
import jmBox from '@/components/box.vue'
	export default {
		components: {
			jmBox
		},
		data() {
			return {
				navChoose: this.$route.params.navChoose || this.$route.query.navChoose || 0,
				navList: {
					title: '新闻资讯',
					listinlist: true, // 判断列表内是否还有列表
					list: this.$store.state.newsList || []
				}
			}
		},
		mounted() {
			this.init()
		},
		methods: {
			navListC(index) {
				this.navChoose = index
			},
			init() {
				this.getdataList()
			},
			getdataList() {
				getList({},17).then(({data}) => {
					console.log(data);
					this.navList.list = data
					this.$store.commit('setNewsList',data)
				})
			},
			navListC(index) {
				this.navChoose = index
			}
		}
	}
</script>

<style>
</style>
