Skip to content

Commit

Permalink
docs(zh): Update state.md (#2136)
Browse files Browse the repository at this point in the history
  • Loading branch information
kongweigen committed Jul 16, 2023
1 parent 0b7cab3 commit 58e0708
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions packages/docs/zh/core-concepts/state.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ const useStore = defineStore('storeId', {

## TypeScript %{#typescript}%

你并不需要做太多努力就能使你的 state 兼容 TS。 Pinia 会自动推断出你的 state 的类型,但在一些情况下,你得用一些方法来帮它一把。

你并不需要做太多努力就能使你的 state 兼容 TS。确保启用了 strict,或者至少启用了 noImplicitThis,Pinia 将自动推断您的状态类型! 但是,在某些情况下,您应该帮助它进行一些转换:
```ts
const useStore = defineStore('storeId', {
state: () => {
Expand Down

0 comments on commit 58e0708

Please sign in to comment.