Skip to content

Commit

Permalink
docs: detailed client hooks migration
Browse files Browse the repository at this point in the history
  • Loading branch information
JOU-amjs committed Jul 30, 2024
1 parent de004d0 commit 1498030
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion docs/tutorial/07-project/02-migration/01-v2-to-v3.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@ import adapterFetch from 'alova/fetch';
```javascript
// v2
import { useRequest } from 'alova';
import { usePagination, useForm } from '@alova/scene-[vue/react/svelte]';

// v3
import { useRequest } from 'alova/client';
import { useRequest, usePagination, useForm } from 'alova/client';
```

3. The cache mode is redesigned, the placeholder mode is removed, and the initialData function can be used to achieve the same effect:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@ import adapterFetch from 'alova/fetch';
```javascript
// v2
import { useRequest } from 'alova';
import { usePagination, useForm } from '@alova/scene-[vue/react/svelte]';

// v3
import { useRequest } from 'alova/client';
import { useRequest, usePagination, useForm } from 'alova/client';
```

3. 缓存模式重新设计,placeholder 模式被移除,可使用 initialData 函数实现相同效果:
Expand Down

0 comments on commit 1498030

Please sign in to comment.