<div v-if="isHadMessage">
暂无消息
</div>
<div v-else>
<div v-if="isLoading" @click="loadMore">
点击加载更多......
</div>
</div>
import CaseSearch from '@/api/system/caseSearch.js'
data(){
return{
tableData: [],
current: 1,
size: 10,
total: 1,
all: ''
isHadMessage: false,
isLoading: true
}
}
mounted(){
this.pagindLoad()
}
methods: {
pagindLoad(){
let params = {
size: this.size,
current: this.current
}
CaseSearch.message(params).then(res=>{
if(res.data.all === 0){
this.isHadMessage = false
}else{
if(this.tableData.length < res.data.all){
this.total = res.data.total
this.tableData = this.tableData.concat(res.data.data)
if(this.tableData.length === res.data.all){
this.isLoading = false
}
}
}
})
},
loadMore(){
this.current++
this.pagindLoad()
}
}