Currently, I have integrated debounce from lodash into my main.js file.
import lodash from 'lodash'
Vue.prototype._ = lodash
I've been utilizing it like this._.find(...)
, and everything has been functioning smoothly. However, when attempting to use debounce, it fails to work.
<script>
export default {
methods: {
delay: this._.debounce(function () {
// Code
}, 500),
}
}
</script>
An error is being thrown stating
Uncaught TypeError: Cannot read property 'debounce' of undefined
What could be the correct approach in utilizing this._.debounce(...)
?