Migrate to vue-request v2.x
masterIf you are upgrading from v1.x to v2.x, note the following breaking changes:
- Service Wrapper: The
serviceoption no longer supports strings or objects directly. You must wrap your request library (e.g.,axios) in a function that returns aPromise. - Result Formatting:
formatResulthas been removed. You should handle data transformation directly within yourservicefunction. - Parallel Mode:
queryKeyhas been removed, which means parallel request mode is no longer supported. It is recommended to encapsulate each request and its UI into its own component. - Ready Logic:
- When
manual=false, a request is automatically triggered wheneverreadychanges fromfalsetotrue(usingoptions.defaultParams). - When
manual=true, a request cannot be initiated as long asreadyisfalse.
- When
- Async Execution: The
runmethod no longer returns aPromise. UserunAsyncinstead if you need to await the result. - Component Replacement:
RequestConfigcomponent has been removed. You can achieve similar results by wrapping your logic withuseRequestProvider.