From: 培根666 <421505648@qq.com> Date: Sun, 16 Jul 2023 07:04:04 +0000 (+0800) Subject: docs(zh): Update state.md (#2136) X-Git-Tag: @pinia/testing@0.1.3~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=58e0708f375cf42a02d05c538ddbdc997e5a21c9;p=thirdparty%2Fvuejs%2Fpinia.git docs(zh): Update state.md (#2136) --- diff --git a/packages/docs/zh/core-concepts/state.md b/packages/docs/zh/core-concepts/state.md index 276e9741..a6dbc227 100644 --- a/packages/docs/zh/core-concepts/state.md +++ b/packages/docs/zh/core-concepts/state.md @@ -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: () => {