I am using debounce from lodash which is imported in main.js
import lodash from 'lodash'
Vue.prototype._ = lodash
And I am using like this._.find(...)
, it's all working fine. But if i use debounce it is not working.
<script>
export default {
methods: {
delay: this._.debounce(function () {
// Code
}, 500),
}
}
</script>
It throws this error Uncaught TypeError: Cannot read property 'debounce' of undefined
What could be the right way to use the this._.debounce(...)
?