From: 0x3E5 <4722957@qq.com> Date: Fri, 21 Apr 2023 13:56:51 +0000 (+0800) Subject: docs(zh): Update actions.md (#2155) X-Git-Tag: @pinia/nuxt@0.4.10~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=27d490eb9cdb662591f41e590df0a75ccc21caaa;p=thirdparty%2Fvuejs%2Fpinia.git docs(zh): Update actions.md (#2155) Correction chinese expression. --- diff --git a/packages/docs/zh/core-concepts/actions.md b/packages/docs/zh/core-concepts/actions.md index 220f5f55..12662ec1 100644 --- a/packages/docs/zh/core-concepts/actions.md +++ b/packages/docs/zh/core-concepts/actions.md @@ -162,7 +162,7 @@ export default { ## 订阅 action %{#subscribing-to-actions}% -你可以通过 `store.$onAction()` 来监听 action 和它们的结果。传递给它的回调函数会在 action 本身之前执行。`after` 表示在 promise 解决之后,允许你在 action 解决后执行一个一个回调函数。同样地,`onError` 允许你在 action 抛出错误或 reject 时执行一个回调函数。这些函数对于追踪运行时错误非常有用,类似于[Vue docs 中的这个提示](https://v3.vuejs.org/guide/tooling/deployment.html#tracking-runtime-errors)。 +你可以通过 `store.$onAction()` 来监听 action 和它们的结果。传递给它的回调函数会在 action 本身之前执行。`after` 表示在 promise 解决之后,允许你在 action 解决后执行一个回调函数。同样地,`onError` 允许你在 action 抛出错误或 reject 时执行一个回调函数。这些函数对于追踪运行时错误非常有用,类似于[Vue docs 中的这个提示](https://v3.vuejs.org/guide/tooling/deployment.html#tracking-runtime-errors)。 这里有一个例子,在运行 action 之前以及 action resolve/reject 之后打印日志记录。