docs(api-client): update doc

This commit is contained in:
chenos 2022-01-29 17:31:40 +08:00
parent 8da98d8c2b
commit 2929c77775

View File

@ -42,6 +42,15 @@ const instance = axios.create({
baseURL: '',
});
const apiClient = new APIClient(instance);
// 常规请求
const response = await apiClient.request({ url });
// NocoBase 特有的资源操作
const response = await apiClient.resource('posts').list();
// 请求共享
const { data, loading, run } = apiClient.service('uid');
```
`api.service(uid)` 的例子ComponentB 里刷新 ComponentA 的请求数据