主要技术路线
elementUI+axios+springboot
提供分页测试数据接口地址。页面组件地址
element表格与对话框
1 | <template> |
axios获取数据
npm install axios –save1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38<script>
import axios from "axios";
export default {
data() {
return {
name: "表格",
listQuery: {
page: 1,
limit: 3,
},
newusers: [],
total: null
};
},
created() {
this.getUsers()
},
methods: {
getUsers() {
axios
.get("http://localhost:8888/getList",{
params:{
pageNum:this.listQuery.page,
pageSize:this.listQuery.limit
}
})
.then(response => {
console.log(response);
this.newusers = response.data.list
this.total=response.data.total
})
.catch(error => {
console.log("axios==" + error);
});
}
}
};
</script>
springboot 集成PageHelper分页
pom.xml
1 | <!--pagehelper --> |
UserController
1 | /** |
UserServiceImpl实现类
1 |
|
结合以上三个技术就可以实现分页功能了。