Skip to content

RefreshDeps

useRequest provides an options.refreshDeps,Instead of watch, it will listen for changes in responsive values and reissue requests when the values change .

remark

When the automatic, mode manual is not true and refreshDeps will take effect.

Manual collection of dependencies

When refreshDeps passes in an array of responsive objects, when its value changes, the request will be retriggered.

Automatically collect dependencies

When refreshDeps is passed in true, useRequest will automatically collect the response object parameters in the function parameters, as long as the response object in the parameters changes, it will carry the latest value to re-initiate the request.

API

Options

PropertyDescriptionTypeDefault
refreshDeps
  • Dependent on responsive objects, and the watch incoming listener object usage for vue
  • If set to true, the dependency execution is automatically collected and is also supported with ready
boolean | WatchSource[]-

Source

SourceDocsDemo