写一个VUE前端分页查询程序代码
时间: 2023-03-13 12:00:20 浏览: 106
vue实现前端分页完整代码
我可以为你提供一个VUE前端分页查询程序的代码示例:<template>
<div>
<div>
<input v-model="page">
<input v-model="pageSize">
<button @click="fetchData">查询</button>
</div>
<ul>
<li v-for="item in list">{{item}}</li>
</ul>
</div>
</template><script>
export default {
data() {
return {
page: 1,
pageSize: 10,
list: []
}
},
methods: {
fetchData(){
this.$http.get('http://api.xxx.com/list', {
params: {
page: this.page,
pageSize: this.pageSize
}
}).then(res => {
this.list = res.data;
})
}
}
}
</script>
阅读全文