/**
 * author: dabao
 */
var VUE = null
window.addEventListener("load", function() {
	VUE = new Vue({
		el: '#app',
		data() {
			return {
				companyName: '',
				value: '',
				list: [],
				loading: false,
				finished: false,
				page: 0,
				size: 999,
				total: 0
			}
		},
		mounted() {
			this.getList()
		},
		methods: {
			nav(item){
				location.href='./law-lv2.html?pid=' + item.id
			},
			getList(){
				http.get('/api/lawCategory',{
					page: this.page++,// 每次请求增加下一页
					size: this.size,
					county: localStorage.getItem('appCounty'),
				}).then((res)=>{
					
					this.loading = false; // 加载状态结束
					this.list.push(...res.content);
					this.total = res.totalElements
					
					if(this.page*this.size >= this.total){
						 this.finished = true; // 下滑不在刷新数据
					}
				})
				
			}
		},
	});
});