layout-table.vue
916 Bytes
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
<template>
<div class="layout-table">
<slot></slot>
<div class="footer">
<div class="footer-left">
<slot name="footer"></slot>
</div>
<div class="footer-right">
<i-page
:current="current"
:total="total"
:page-size="pageSize"
@on-change="onChange"></i-page>
</div>
</div>
</div>
</template>
<script>
export default {
name: 'LayoutTable',
props: {
total: Number,
},
data() {
return {
current: 1,
pageSize: 10
};
},
methods: {
onChange(page) {
this.current = page;
this.$emit('on-page-change', page);
}
}
}
</script>
<style lang="scss" scoped>
.layout-table {
padding: 10px 0;
.footer {
width: 100%;
display: flex;
padding: 10px 0;
}
.footer-left {
flex: 1;
}
.footer-right {
width: 500px;
text-align: right;
}
}
</style>