vue-request
vue-request copied to clipboard
fix: undefined injectedGlobalOptions close #182
fix: undefined injectedGlobalOptions close #182
Can you provide a reproducible example?
@John60676 So, I don't know exactly how to reproduce it and probably it's not a problem of vue-request..
After digging I've found that is related to Nuxt and to this bug
Because moving the usePagination() BEFORE the await useAsyncData() fix the problem.
So i think in some ways the inject lose its context after the await so the undefined injectedGlobalOptions error appear in the console and is annoying.
when usePagination used in typescript or JavaScript, inject will return undefined。
I think use renderless component is much better than provide/inject
@LuXDAmore @John60676 @neostfox , so everyone? how to fix this? i have this problem when implementing ant-design-vue ajax table in vue js and i can't found any related post/thread except this
@sugionosihuahua for me the solution was to move the usePagination() BEFORE every others await used in the component.
@LuXDAmore thx for the reply, however in my case this happened because i put data result inside another array in the backend response (same as documentation in the ant-design-vue table, they put data in the "results" key). so now i can do just fine.
i also meet the problem, plz merge the pr