I have a function need to write async but I can\'t do it the right way. Hope your guys help.
async search (loading, search, vm) {
let vm = this
_.debounc
You should avoid using the debounce function provided by Lodash when dealing with promises since it doesn't distinguish sync and async function and works like if the function you fed it was synchronous. So it doesn't wait till the promise is resolved or rejected and returns immediately. This means that the time spent for, say ajax request, doesn't count towards function execution time, and in case of network delay it's possible for the responses to come in different order.
I suggest to pick up the awesome-debounce-promise on npm.