Skip to main content

进阶

进阶教程可以让你更深入地了解 alova 的一些特性,它们可能并不是常用功能,但可以帮你快速解决更多特殊的请求问题。

📄️ Manage extra states

In the previous Cross Page/Module Update Response States chapter, we introduced how to update the response status across pages or modules, but in this chapter we It only introduces updating the data state returned by useRequest and useWatcher through updateState, the value of data is always consistent with the response data, but in many cases we will use additional states(such as state A) to display data, and After the request is successful, the data data is appended to the additional state A, such as the pagination scheme of pull-down loading. In this case, we need to manage the additional state A so that it can be updated across pages/modules.