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 =" shouldDisable " >
16
16
<md-icon >keyboard_arrow_right</md-icon >
17
17
</md-button >
18
18
</div >
47
47
data () {
48
48
return {
49
49
subTotal: 0 ,
50
- currentSize : parseInt ( this . mdSize , 10 ) ,
51
- currentPage: parseInt ( this . mdPage , 10 ) ,
52
- totalItems : isNaN ( this . mdTotal ) ? Number . MAX_SAFE_INTEGER : parseInt ( this . mdTotal , 10 )
50
+ totalItems : 0 ,
51
+ currentPage: 1 ,
52
+ currentSize : 0
53
53
};
54
54
},
55
+ watch: {
56
+ mdTotal (val ) {
57
+ this .totalItems = isNaN (val) ? Number .MAX_SAFE_INTEGER : parseInt (val, 10 );
58
+ },
59
+ mdSize (val ) {
60
+ this .currentSize = parseInt (val, 10 );
61
+ },
62
+ mdPage (val ) {
63
+ this .currentPage = parseInt (val, 10 );
64
+ }
65
+ },
55
66
computed: {
56
67
lastPage () {
57
68
return false ;
69
+ },
70
+ shouldDisable () {
71
+ return this .currentSize * this .currentPage >= this .totalItems ;
58
72
}
59
73
},
60
74
methods: {
You can’t perform that action at this time.
0 commit comments