vue-request
vue-request copied to clipboard
[Bug Report] undefined injectedGlobalOptions
Bug 描述 Bug description
In the usePagination function we are running into the problem that injectedGlobalOptions
are undefined in this line
pagination: (_injectedGlobalOption = injectedGlobalOptions.pagination) !== null && _injectedGlobalOption !== void 0 ? _injectedGlobalOption : {}
When just replacing injectedGlobalOptions.pagination
with injectedGlobalOptions?.pagination
it works.
代码重现 Reproduce
I honestly dont know how to reproduce it.
期望结果 Desired result
No undefined error and breaking the code.
其他信息 Other information
Same for me
This line is undefined
const injectedGlobalOptions = vueDemi.inject(GLOBAL_OPTIONS_PROVIDE_KEY, {}); I'm using the same service on every page with the same data, but just in one page is broken with this error.
我出现类似问题,最终发现是各个组件库依赖的vue-demi的版本不一致导致的问题
我也遇到了类似的问题,出现的情况是没有在正确的inject环境使用,vue-request 应该排除 没有inject的情况时,也能正确使用,比如在一个js文件中使用时