File tree Expand file tree Collapse file tree 1 file changed +37
-0
lines changed Expand file tree Collapse file tree 1 file changed +37
-0
lines changed Original file line number Diff line number Diff line change 1+ module . exports = {
2+
3+ template : '<a v-show="sorttype === \'asc\'" @click="sortData(data)">\
4+ {{ label }} <i class="down black icon" :class="icon" v-if="sort === 1"></i>\
5+ </a>\
6+ <a v-show="sorttype === \'desc\'" @click="sortData(data)">\
7+ {{ label }} <i class="up black icon" :class="icon" v-if="sort === 1"></i>\
8+ </a>' ,
9+
10+ props : {
11+ label : {
12+ type : String ,
13+ default : 'Sort Me' ,
14+ required : false
15+ } ,
16+ icon : {
17+ type : String ,
18+ default : 'chevron' ,
19+ required : false
20+ } ,
21+ data : {
22+ type : Object ,
23+ default : function ( ) {
24+ return {
25+ sort : null ,
26+ sorttype : null ,
27+ }
28+ } ,
29+ required : true
30+ }
31+ } ,
32+ methods : {
33+ sortData ( sort , direction ) {
34+ this . $emit ( 'sort-data' , sort , direction ) ;
35+ } ,
36+ }
37+ }
You can’t perform that action at this time.
0 commit comments