This repository was archived by the owner on Jun 10, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +40
-0
lines changed Expand file tree Collapse file tree 1 file changed +40
-0
lines changed Original file line number Diff line number Diff line change @@ -82,6 +82,46 @@ export default {
8282 return temp
8383 } ,
8484
85+ /**
86+ * Function to $emit a sort event
87+ * @param {Exception } e
88+ * @param {String } key
89+ * @return void
90+ */
91+ sortColumn ( e , key ) {
92+ if ( this . columnSortSelected . key === key ) {
93+ this . columnSortSelected . order = ! this . columnSortSelected . order
94+ } else {
95+ this . columnSortSelected . order = false
96+ this . columnSortSelected . key = key
97+ }
98+ this . $emit ( 'column-sort' , this . columnSortSelected )
99+ } ,
100+
101+ /**
102+ * Function to show up arrow
103+ * @param {String } key
104+ * @return Boolean
105+ */
106+ shouldShowUpArrow ( key ) {
107+ return ( this . columnSortSelected . key === key ) && ( this . columnSortSelected . order === true )
108+ } ,
109+
110+ /**
111+ * Function to show down arrow
112+ * @param {String } key
113+ * @return Boolean
114+ */
115+ shouldShowDownArrow ( key ) {
116+ return ( this . columnSortSelected . key === key ) && ( this . columnSortSelected . order === false )
117+ } ,
118+
119+ /**
120+ * Function to get a value rounded
121+ * @param {Number } value
122+ * @param {Number } precision
123+ * @return Number
124+ */
85125 roundNumber ( value , precision ) {
86126 let multiplier = Math . pow ( 10 , precision || 0 )
87127 return Math . round ( value * multiplier ) / multiplier
You can’t perform that action at this time.
0 commit comments