Skip to content

Commit 947bf65

Browse files
committed
docs: refactor
1 parent a29ff0f commit 947bf65

39 files changed

+544
-541
lines changed

packages/docs/core-concepts/actions.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,13 +116,13 @@ import { defineStore } from 'pinia'
116116

117117
export const useCounterStore = defineStore('counter', {
118118
state: () => ({
119-
count: 0
119+
count: 0,
120120
}),
121121
actions: {
122122
increment() {
123123
this.count++
124-
}
125-
}
124+
},
125+
},
126126
})
127127
```
128128

packages/docs/core-concepts/outside-component-usage.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ If you are not doing any SSR (Server Side Rendering), any call of `useStore()` a
1515

1616
```js
1717
import { useUserStore } from '@/stores/user'
18-
import { createPinia } from 'pinia';
18+
import { createPinia } from 'pinia'
1919
import { createApp } from 'vue'
2020
import App from './App.vue'
2121

packages/docs/introduction.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Pinia [started](https://github.com/vuejs/pinia/commit/06aeef54e2cad66696063c6282
1414

1515
## Why should I use Pinia?
1616

17-
<!--
17+
<!--
1818
https://masteringpinia.com/lessons/why-use-pinia
1919
-->
2020

packages/docs/zh/api/enums/pinia.MutationType.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
sidebar: "auto"
2+
sidebar: 'auto'
33
editLinks: false
44
sidebarDepth: 3
55
---
@@ -16,29 +16,29 @@ SubscriptionCallback 的可能类型
1616

1717
### direct %{#direct}%
1818

19-
**direct** = ``"direct"``
19+
**direct** = `"direct"`
2020

2121
Direct mutation of the state:
2222

2323
- `store.name = 'new name'`
2424
- `store.$state.name = 'new name'`
2525
- `store.list.push('new item')`
2626

27-
___
27+
---
2828

2929
### patchFunction %{#patchfunction}%
3030

31-
**patchFunction** = ``"patch function"``
31+
**patchFunction** = `"patch function"`
3232

3333
通过 `$patch` 和一个函数更改 state:
3434

3535
- `store.$patch(state => state.name = 'newName')`
3636

37-
___
37+
---
3838

3939
### patchObject %{#patchobject}%
4040

41-
**patchObject** = ``"patch object"``
41+
**patchObject** = `"patch object"`
4242

4343
通过 `$patch` 和一个对象更改 state:
4444

packages/docs/zh/api/interfaces/pinia.DefineSetupStoreOptions.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
sidebar: "auto"
2+
sidebar: 'auto'
33
editLinks: false
44
sidebarDepth: 3
55
---
@@ -19,12 +19,12 @@ sidebarDepth: 3
1919

2020
## 类型参数 %{#type-parameters}%
2121

22-
| 名称 | 类型 |
23-
| :------ | :------ |
24-
| `Id` | extends `string` |
25-
| `S` | extends [`StateTree`](../modules/pinia.md#statetree) |
26-
| `G` | `G` |
27-
| `A` | `A` |
22+
| 名称 | 类型 |
23+
| :--- | :--------------------------------------------------- |
24+
| `Id` | extends `string` |
25+
| `S` | extends [`StateTree`](../modules/pinia.md#statetree) |
26+
| `G` | `G` |
27+
| `A` | `A` |
2828

2929
## 层次结构 %{#hierarchy}%
3030

packages/docs/zh/api/interfaces/pinia.DefineStoreOptions.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
sidebar: "auto"
2+
sidebar: 'auto'
33
editLinks: false
44
sidebarDepth: 3
55
---
@@ -19,12 +19,12 @@ sidebarDepth: 3
1919

2020
## 类型参数 %{#type-parameters}%
2121

22-
| 名字 | 类型 |
23-
| :------ | :------ |
24-
| `Id` | extends `string` |
25-
| `S` | extends [`StateTree`](../modules/pinia.md#statetree) |
26-
| `G` | `G` |
27-
| `A` | `A` |
22+
| 名字 | 类型 |
23+
| :--- | :--------------------------------------------------- |
24+
| `Id` | extends `string` |
25+
| `S` | extends [`StateTree`](../modules/pinia.md#statetree) |
26+
| `G` | `G` |
27+
| `A` | `A` |
2828

2929
## 层次结构 %{#hierarchy}%
3030

@@ -40,23 +40,23 @@ sidebarDepth: 3
4040

4141
action 的可选对象
4242

43-
___
43+
---
4444

4545
### getters %{#getters}%
4646

4747
`Optional` **getters**: `G` & `ThisType`<`UnwrapRef`<`S`\> & [`_StoreWithGetters`](../modules/pinia.md#_storewithgetters)<`G`\> & [`PiniaCustomProperties`](pinia.PiniaCustomProperties.md)<`string`, [`StateTree`](../modules/pinia.md#statetree), [`_GettersTree`](../modules/pinia.md#_getterstree)<[`StateTree`](../modules/pinia.md#statetree)\>, [`_ActionsTree`](../modules/pinia.md#_actionstree)\>\> & [`_GettersTree`](../modules/pinia.md#_getterstree)<`S`\>
4848

4949
getter 的可选对象
5050

51-
___
51+
---
5252

5353
### id %{#id}%
5454

5555
**id**: `Id`
5656

5757
唯一的字符串密钥,用于识别整个应用中的 store。
5858

59-
___
59+
---
6060

6161
### state %{#state}%
6262

@@ -91,21 +91,21 @@ ___
9191
```ts
9292
const useStore = defineStore('main', {
9393
state: () => ({
94-
n: useLocalStorage('key', 0)
94+
n: useLocalStorage('key', 0),
9595
}),
9696
hydrate(storeState, initialState) {
9797
// @ts-expect-error: https://github.com/microsoft/TypeScript/issues/43826
9898
storeState.n = useLocalStorage('key', 0)
99-
}
99+
},
100100
})
101101
```
102102

103103
#### 参数
104104

105-
| 名字 | 类型 | 描述 |
106-
| :------ | :------ | :------ |
107-
| `storeState` | `UnwrapRef`<`S`\> | the current state in the store |
108-
| `initialState` | `UnwrapRef`<`S`\> | initialState |
105+
| 名字 | 类型 | 描述 |
106+
| :------------- | :---------------- | :----------------------------- |
107+
| `storeState` | `UnwrapRef`<`S`\> | the current state in the store |
108+
| `initialState` | `UnwrapRef`<`S`\> | initialState |
109109

110110
#### 返回值
111111

packages/docs/zh/api/interfaces/pinia.DefineStoreOptionsBase.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
sidebar: "auto"
2+
sidebar: 'auto'
33
editLinks: false
44
sidebarDepth: 3
55
---
@@ -16,10 +16,10 @@ sidebarDepth: 3
1616

1717
## 类型参数 %{#type-parameters}%
1818

19-
| Name | Type |
20-
| :------ | :------ |
21-
| `S` | extends [`StateTree`](../modules/pinia.md#statetree) |
22-
| `Store` | `Store` |
19+
| Name | Type |
20+
| :------ | :--------------------------------------------------- |
21+
| `S` | extends [`StateTree`](../modules/pinia.md#statetree) |
22+
| `Store` | `Store` |
2323

2424
## 层次结构 %{#hierarchy}%
2525

packages/docs/zh/api/interfaces/pinia.DefineStoreOptionsInPlugin.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
sidebar: "auto"
2+
sidebar: 'auto'
33
editLinks: false
44
sidebarDepth: 3
55
---
@@ -14,16 +14,16 @@ sidebarDepth: 3
1414

1515
## 类型参数 %{#type-parameters}%
1616

17-
| 名字 | 类型 |
18-
| :------ | :------ |
19-
| `Id` | extends `string` |
20-
| `S` | extends [`StateTree`](../modules/pinia.md#statetree) |
21-
| `G` | `G` |
22-
| `A` | `A` |
17+
| 名字 | 类型 |
18+
| :--- | :--------------------------------------------------- |
19+
| `Id` | extends `string` |
20+
| `S` | extends [`StateTree`](../modules/pinia.md#statetree) |
21+
| `G` | `G` |
22+
| `A` | `A` |
2323

2424
## 层次结构 %{#hierarchy}%
2525

26-
- `Omit`<[`DefineStoreOptions`](pinia.DefineStoreOptions.md)<`Id`, `S`, `G`, `A`\>, ``"id"`` \| ``"actions"``\>
26+
- `Omit`<[`DefineStoreOptions`](pinia.DefineStoreOptions.md)<`Id`, `S`, `G`, `A`\>, `"id"` \| `"actions"`\>
2727

2828
**`DefineStoreOptionsInPlugin`**
2929

@@ -37,7 +37,7 @@ sidebarDepth: 3
3737
否则使用传递给 `defineStore()` 的对象。
3838
如果没有定义 action,则默认为一个空对象。
3939

40-
___
40+
---
4141

4242
### getters %{#getters}%
4343

@@ -49,7 +49,7 @@ getter 的可选对象
4949

5050
Omit.getters
5151

52-
___
52+
---
5353

5454
### state
5555

@@ -88,21 +88,21 @@ Omit.state
8888
```ts
8989
const useStore = defineStore('main', {
9090
state: () => ({
91-
n: useLocalStorage('key', 0)
91+
n: useLocalStorage('key', 0),
9292
}),
9393
hydrate(storeState, initialState) {
9494
// @ts-expect-error: https://github.com/microsoft/TypeScript/issues/43826
9595
storeState.n = useLocalStorage('key', 0)
96-
}
96+
},
9797
})
9898
```
9999

100100
#### 参数
101101

102-
| 名字 | 类型 | 描述 |
103-
| :------ | :------ | :------ |
104-
| `storeState` | `UnwrapRef`<`S`\> | the current state in the store |
105-
| `initialState` | `UnwrapRef`<`S`\> | initialState |
102+
| 名字 | 类型 | 描述 |
103+
| :------------- | :---------------- | :----------------------------- |
104+
| `storeState` | `UnwrapRef`<`S`\> | the current state in the store |
105+
| `initialState` | `UnwrapRef`<`S`\> | initialState |
106106

107107
#### 返回值
108108

packages/docs/zh/api/interfaces/pinia.MapStoresCustomization.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
sidebar: "auto"
2+
sidebar: 'auto'
33
editLinks: false
44
sidebarDepth: 3
55
---

packages/docs/zh/api/interfaces/pinia.Pinia.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
sidebar: "auto"
2+
sidebar: 'auto'
33
editLinks: false
44
sidebarDepth: 3
55
---
@@ -30,15 +30,15 @@ Every application must own its own pinia to be able to create stores
3030

3131
##### 参数
3232

33-
| Name | Type |
34-
| :------ | :------ |
33+
| Name | Type |
34+
| :---- | :------------ |
3535
| `app` | `App`<`any`\> |
3636

3737
##### 返回值
3838

3939
`void`
4040

41-
___
41+
---
4242

4343
### state %{#state}%
4444

@@ -56,8 +56,8 @@ ___
5656

5757
#### 参数 %{#paramters}%
5858

59-
| Name | Type | Description |
60-
| :------ | :------ | :------ |
59+
| Name | Type | Description |
60+
| :------- | :------------------------------------ | :------------------ |
6161
| `plugin` | [`PiniaPlugin`](pinia.PiniaPlugin.md) | store plugin to add |
6262

6363
#### 返回值

0 commit comments

Comments
 (0)