File tree Expand file tree Collapse file tree 1 file changed +18
-4
lines changed Expand file tree Collapse file tree 1 file changed +18
-4
lines changed Original file line number Diff line number Diff line change 12
12
<md-icon >keyboard_arrow_left</md-icon >
13
13
</md-button >
14
14
15
- <md-button class =" md-icon-button md-table-pagination-next" @click.native =" nextPage" :disabled =" currentSize * currentPage >= totalItems " >
15
+ <md-button class =" md-icon-button md-table-pagination-next" @click.native =" nextPage" :disabled =" hasMoreItems " >
16
16
<md-icon >keyboard_arrow_right</md-icon >
17
17
</md-button >
18
18
</div >
46
46
data () {
47
47
return {
48
48
subTotal: 0 ,
49
- currentSize : parseInt ( this . mdSize , 10 ) ,
50
- currentPage: parseInt ( this . mdPage , 10 ) ,
51
- totalItems : isNaN ( this . mdTotal ) ? Number . MAX_SAFE_INTEGER : parseInt ( this . mdTotal , 10 )
49
+ totalItems : 0 ,
50
+ currentPage: 1 ,
51
+ currentSize : 0
52
52
};
53
53
},
54
+ watch: {
55
+ mdTotal (val ) {
56
+ this .totalItems = isNaN (val) ? Number .MAX_SAFE_INTEGER : parseInt (val, 10 );
57
+ },
58
+ mdSize (val ) {
59
+ this .currentSize = parseInt (this .mdSize , 10 );
60
+ },
61
+ mdPage (val ) {
62
+ this .currentPage = parseInt (this .mdPage , 10 );
63
+ }
64
+ },
54
65
computed: {
55
66
lastPage () {
56
67
return false ;
68
+ },
69
+ hasMoreItems () {
70
+ return this .currentSize * this .currentPage >= this .totalItems ;
57
71
}
58
72
},
59
73
methods: {
You can’t perform that action at this time.
0 commit comments