Here is the code for my component:
<script>
import _ from 'lodash'
export default{
props:['search','category'],
data(){
return{
price_min:'',
price_max:''
}
},
computed:{
filters(data){
const price = {min:this.price_min, max:this.price_max}
return {q:this.search, category:this.category, sort:data, location:data, price}
},
},
methods:{
filterProduct: _.debounce(function(data=null){
this.$store.dispatch('getProducts', this.filters(data))
},500)
}
}
</script>
You can view the full code here.
After executing the code, I encountered an error in the console:
Uncaught TypeError: this.filters is not a function
Any suggestions on how to resolve this error?