Is there a way to create a conditional statement based on the user's route?
refreshData (){
var params = {};
for (var key in this.filters) {
if (this.filters.hasOwnProperty(key)) {
if (
this.filters[key] == 0 ||
this.filters[key] == false ||
(this.filters[key] && this.filters[key] !== '')
) {
params[key] = mapFilter(this.filters[key]);
}
}
}
if (url == osdata) {
this.$root.$emit('refreshData', params);
}
if(url == bidata){
this.$root.$emit('refereshBi', params);
}
I attempted to add some if statements at the end, but it did not work as expected. What would be the correct approach in this case?