File tree Expand file tree Collapse file tree 2 files changed +22
-9
lines changed Expand file tree Collapse file tree 2 files changed +22
-9
lines changed Original file line number Diff line number Diff line change @@ -134,14 +134,15 @@ export default {
134
134
this .runsArray = data;
135
135
this .config .runs = data;
136
136
});
137
-
138
- // TODO: Migrate this line from San to Vue
139
- // need debounce, can't use computed
140
- // this.watch('config.groupNameReg', debounce(this.filterTagsList, 300));
141
137
},
142
138
mounted () {
143
139
autoAdjustHeight ();
144
140
},
141
+ watch: {
142
+ ' config.groupNameReg ' : function (val ) {
143
+ this .throttledFilterTagsList ()
144
+ }
145
+ },
145
146
methods: {
146
147
filterTagsList (groupNameReg ) {
147
148
if (! groupNameReg) {
@@ -151,7 +152,12 @@ export default {
151
152
let tagsList = this .tagsList || [];
152
153
let regExp = new RegExp (groupNameReg);
153
154
this .filteredTagsList = tagsList .filter (item => regExp .test (item .tag ));
154
- }
155
+ },
156
+ throttledFilterTagsList: _ .debounce (
157
+ function () {
158
+ this .filterTagsList (this .config .groupNameReg )
159
+ }, 300
160
+ ),
155
161
}
156
162
};
157
163
Original file line number Diff line number Diff line change @@ -142,13 +142,15 @@ export default {
142
142
this .runsArray = data;
143
143
this .config .runs = data;
144
144
});
145
-
146
- // TODO: Migrate this line from San to Vue
147
- // this.watch('config.groupNameReg', debounce(this.filterTagsList, 300));
148
145
},
149
146
mounted () {
150
147
autoAdjustHeight ();
151
148
},
149
+ watch: {
150
+ ' config.groupNameReg ' : function (val ) {
151
+ this .throttledFilterTagsList ()
152
+ }
153
+ },
152
154
methods: {
153
155
filterTagsList (groupNameReg ) {
154
156
if (! groupNameReg) {
@@ -158,7 +160,12 @@ export default {
158
160
let tagsList = this .tagsList || [];
159
161
let regExp = new RegExp (groupNameReg);
160
162
this .filteredTagsList = tagsList .filter (item => regExp .test (item .tag ));
161
- }
163
+ },
164
+ throttledFilterTagsList: _ .debounce (
165
+ function () {
166
+ this .filterTagsList (this .config .groupNameReg )
167
+ }, 300
168
+ ),
162
169
}
163
170
};
164
171
You can’t perform that action at this time.
0 commit comments