Skip to content

Commit d446f6b

Browse files
committed
docs: add @alova/shared installation in uniapp
1 parent 386dac6 commit d446f6b

File tree

12 files changed

+85
-37
lines changed

12 files changed

+85
-37
lines changed

docs/resource/01-request-adapter/01-alova-mock.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,13 @@ npm install @alova/mock --save
3030
yarn add @alova/mock
3131
```
3232

33+
</TabItem>
34+
<TabItem value="3" label="pnpm">
35+
36+
```bash
37+
pnpm install @alova/mock
38+
```
39+
3340
</TabItem>
3441
</Tabs>
3542

docs/resource/01-request-adapter/03-xhr.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,13 @@ npm install @alova/adapter-xhr --save
2121
yarn add @alova/adapter-xhr
2222
```
2323

24+
</TabItem>
25+
<TabItem value="3" label="pnpm">
26+
27+
```bash
28+
pnpm install @alova/adapter-xhr
29+
```
30+
2431
</TabItem>
2532
</Tabs>
2633

docs/resource/01-request-adapter/04-axios.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,13 @@ npm install @alova/adapter-axios axios --save
2121
yarn add @alova/adapter-axios axios
2222
```
2323

24+
</TabItem>
25+
<TabItem value="3" label="pnpm">
26+
27+
```bash
28+
pnpm install @alova/adapter-axios axios
29+
```
30+
2431
</TabItem>
2532
</Tabs>
2633

docs/resource/01-request-adapter/05-uniapp.md

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -17,36 +17,25 @@ This plugin only supports vue3 version of uniapp application.
1717
<TabItem value="1" label="npm">
1818

1919
```bash
20-
npm install @alova/adapter-uniapp --save
20+
npm install @alova/adapter-uniapp @alova/shared --save
2121
```
2222

2323
</TabItem>
2424
<TabItem value="2" label="yarn">
2525

2626
```bash
27-
yarn add @alova/adapter-uniapp
27+
yarn add @alova/adapter-uniapp @alova/shared
2828
```
2929

3030
</TabItem>
31-
</Tabs>
32-
33-
:::warning
34-
35-
In uniapp+vite, `@rollup/plugin-node-resolve` needs to be configured, otherwise it may cause an error that the dependency cannot be found.
36-
37-
[#535 discussion](https://github.com/orgs/alovajs/discussions/535)
38-
39-
```js
40-
import { defineConfig } from 'vite';
41-
import uni from '@dcloudio/vite-plugin-uni';
42-
import { nodeResolve } from '@rollup/plugin-node-resolve';
31+
<TabItem value="3" label="pnpm">
4332

44-
export default defineConfig({
45-
plugins: [uni(), nodeResolve()]
46-
});
33+
```bash
34+
pnpm install @alova/adapter-uniapp @alova/shared
4735
```
4836

49-
:::
37+
</TabItem>
38+
</Tabs>
5039

5140
## Usage
5241

docs/resource/01-request-adapter/06-taro.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,13 @@ npm install @alova/adapter-taro --save
2727
yarn add @alova/adapter-taro
2828
```
2929

30+
</TabItem>
31+
<TabItem value="3" label="pnpm">
32+
33+
```bash
34+
pnpm install @alova/adapter-taro
35+
```
36+
3037
</TabItem>
3138
</Tabs>
3239

@@ -40,7 +47,7 @@ If you are develop a React-Native app with Taro, please ensure `metro >= 0.76.0`
4047

4148
:::warning Dependency precompilation issues
4249

43-
[Dependency precompilation function](https://docs.taro.zone/blog/2022/05/19/Taro-3.5-beta#2-%E4%BE%9D%E8%B5%96%E9%A2%84%E7%BC%96%E8%AF%91) has been added in Taro v3.5 beta, and is enabled by default in development mode when you are using the `alova` library and `@alova/scene-react(vue)` may cause the error `` [alova]can not call useHooks until set the `statesHook` at alova instance. ``. This is caused by the prebundle feature repeatedly packaging two different `alova` packages. , turning off the prebundle function at this time can solve this problem.
50+
[Dependency precompilation function](https://docs.taro.zone/blog/2022/05/19/Taro-3.5-beta#2-%E4%BE%9D%E8%B5%96%E9%A2%84%E7%BC%96%E8%AF%91) has been added in Taro v3.5 beta, and is enabled by default in development mode when you are using the `alova` library and `@alova/scene-react(vue)` may cause the error ``[alova]can not call useHooks until set the `statesHook` at alova instance.``. This is caused by the prebundle feature repeatedly packaging two different `alova` packages. , turning off the prebundle function at this time can solve this problem.
4451

4552
```js
4653
// config/dev.ts

docs/resource/03-framework/07-vue-options.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,13 @@ npm install alova @alova/vue-options --save
3232
yarn add alova @alova/vue-options
3333
```
3434

35+
</TabItem>
36+
<TabItem value="3" label="pnpm">
37+
38+
```bash
39+
pnpm install alova @alova/vue-options
40+
```
41+
3542
</TabItem>
3643
</Tabs>
3744

i18n/zh-CN/docusaurus-plugin-content-docs/current/resource/01-request-adapter/01-alova-mock.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,13 @@ npm install @alova/mock --save
3030
yarn add @alova/mock
3131
```
3232

33+
</TabItem>
34+
<TabItem value="3" label="pnpm">
35+
36+
```bash
37+
pnpm install @alova/mock
38+
```
39+
3340
</TabItem>
3441
</Tabs>
3542

i18n/zh-CN/docusaurus-plugin-content-docs/current/resource/01-request-adapter/03-xhr.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,13 @@ npm install @alova/adapter-xhr --save
2121
yarn add @alova/adapter-xhr
2222
```
2323

24+
</TabItem>
25+
<TabItem value="3" label="pnpm">
26+
27+
```bash
28+
pnpm install @alova/adapter-xhr
29+
```
30+
2431
</TabItem>
2532
</Tabs>
2633

i18n/zh-CN/docusaurus-plugin-content-docs/current/resource/01-request-adapter/04-axios.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,13 @@ npm install @alova/adapter-axios axios --save
2121
yarn add @alova/adapter-axios axios
2222
```
2323

24+
</TabItem>
25+
<TabItem value="3" label="pnpm">
26+
27+
```bash
28+
pnpm install @alova/adapter-axios axios
29+
```
30+
2431
</TabItem>
2532
</Tabs>
2633

i18n/zh-CN/docusaurus-plugin-content-docs/current/resource/01-request-adapter/05-uniapp.md

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -17,36 +17,25 @@ import TabItem from '@theme/TabItem';
1717
<TabItem value="1" label="npm">
1818

1919
```bash
20-
npm install @alova/adapter-uniapp --save
20+
npm install @alova/adapter-uniapp @alova/shared --save
2121
```
2222

2323
</TabItem>
2424
<TabItem value="2" label="yarn">
2525

2626
```bash
27-
yarn add @alova/adapter-uniapp
27+
yarn add @alova/adapter-uniapp @alova/shared
2828
```
2929

3030
</TabItem>
31-
</Tabs>
32-
33-
:::warning
34-
35-
在 uniapp+vite 中,需要配置`@rollup/plugin-node-resolve`,否则可能导致找不到依赖报错。
36-
37-
[#535 discussion](https://github.com/orgs/alovajs/discussions/535)
38-
39-
```js
40-
import { defineConfig } from 'vite';
41-
import uni from '@dcloudio/vite-plugin-uni';
42-
import { nodeResolve } from '@rollup/plugin-node-resolve';
31+
<TabItem value="3" label="pnpm">
4332

44-
export default defineConfig({
45-
plugins: [uni(), nodeResolve()]
46-
});
33+
```bash
34+
pnpm install @alova/adapter-uniapp @alova/shared
4735
```
4836

49-
:::
37+
</TabItem>
38+
</Tabs>
5039

5140
## 使用方法
5241

0 commit comments

Comments
 (0)