@@ -26,7 +26,7 @@ export default {
26
26
changePage ( page ) {
27
27
this . selected = null
28
28
this . indexSelected = - 1
29
- this . pagination . current_page = page
29
+ this . current_page = page
30
30
this . $emit ( 'change' , { perpage : this . perpage , page : page } )
31
31
} ,
32
32
@@ -50,50 +50,40 @@ export default {
50
50
}
51
51
} ,
52
52
53
- /**
54
- * Computed property: Building custom string information with translation
55
- * @returns {String }
56
- */
57
- tableInfo ( ) {
58
- let labelShow = this . translation . pagination . show
59
- let from = ( this . pagination . from === null ) ? 0 : this . pagination . from
60
- let labelTo = this . translation . pagination . to
61
- let to = ( this . pagination . to === null ) ? 0 : this . pagination . to
62
- let labelOf = this . translation . pagination . of
63
- let total = this . pagination . total
64
- let labelEntries = this . translation . pagination . entries
65
- return `${ labelShow } ${ from } ${ labelTo } ${ to } ${ labelOf } ${ total } ${ labelEntries } `
66
- } ,
67
-
68
53
/**
69
54
* Computed property: Build custom array with the pagination items
70
55
* @return Array
71
56
*/
72
57
gettingItems ( ) {
73
58
let temp = [ ]
74
- let bottomLimit = this . pages . current_page - 2
75
- let topLimit = this . pages . current_page + 2
59
+ let bottomLimit = this . currentPage - 2
60
+ let topLimit = this . currentPage + 2
76
61
let showing = 5
77
62
if ( bottomLimit <= 0 ) {
78
63
bottomLimit = 1
79
64
topLimit = 5
80
65
}
81
- if ( topLimit >= this . pages . last_page ) {
82
- bottomLimit = this . pages . last_page - 4
83
- topLimit = this . pages . last_page
66
+ if ( topLimit >= this . lastPage ) {
67
+ bottomLimit = this . lastPage - 4
68
+ topLimit = this . lastPage
84
69
}
85
- if ( this . pages . last_page < 5 ) {
86
- showing = this . pages . last_page
70
+ if ( this . lastPage < 5 ) {
71
+ showing = this . lastPage
87
72
}
88
73
if ( bottomLimit <= 0 ) {
89
74
bottomLimit = 1
90
75
}
91
- if ( this . pages . last_page === 0 || this . pages . last_page === 1 ) {
76
+ if ( this . lastPage === 0 || this . lastPage === 1 ) {
92
77
showing = 1
93
78
}
94
79
for ( let i = 0 ; i < showing ; i ++ ) {
95
80
temp [ i ] = i + bottomLimit
96
81
}
97
82
return temp
83
+ } ,
84
+
85
+ roundNumber ( value , precision ) {
86
+ let multiplier = Math . pow ( 10 , precision || 0 )
87
+ return Math . round ( value * multiplier ) / multiplier
98
88
}
99
89
}
0 commit comments