1
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
| <template>
| <div class="margT">
| <el-pagination
| background
| :hide-on-single-page="true"
| @current-change="handleCurrentChange"
| @size-change="handleSizeChange"
| layout="total,sizes,prev, pager, next, jumper"
| :page-sizes="[10,20, 50]"
| :page-size="defaultSize"
| :total="currentSize"
| :current-page.sync="currentPage"
| ></el-pagination>
| </div>
| </template>
|
| <script>
| export default {
| props: {
| currentSize:{
| type:Number,
| default:0
| },
| defaultSize:{
| type:Number,
| default:10
| },
| initialize:{
| type:Boolean,
| default:false,
| },
| currentPage:{
| type:Number,
| default:1
| }
| },
| name: "page",
| data() {
| return {};
| },
| watch:{
| initialize(val,old){
| if(val===true){
| this.currentPage=1;
| this.$emit("successInit");
| this.$emit("update:initialize",false)
| }
| }
| },
| methods: {
| handleCurrentChange(val) {
| this.$emit("pageSize", { data: val, type: "change" });
| },
| handleSizeChange(val) {
| this.currentSync=1
| this.$emit("pageSize", { data: val, type: "size" });
| }
| },
| created() {}
| };
| </script>
| <style scoped>
| .margT{
| margin-top: 20px;
| }
| </style>
|
|