From: 1sm <31946591+1sm23@users.noreply.github.com> Date: Wed, 22 Dec 2021 09:58:23 +0000 (+0800) Subject: docs: beforeRouteUpdate (#1255) X-Git-Tag: v4.0.13~42 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=edfd4e0ceba983d9a5dbf19cf28dd27370273d98;p=thirdparty%2Fvuejs%2Frouter.git docs: beforeRouteUpdate (#1255) --- diff --git a/docs/zh/guide/advanced/composition-api.md b/docs/zh/guide/advanced/composition-api.md index a06f8688..060e97de 100644 --- a/docs/zh/guide/advanced/composition-api.md +++ b/docs/zh/guide/advanced/composition-api.md @@ -69,7 +69,7 @@ export default { const userData = ref() - // 与 beforeRouteLeave 相同,无法访问 `this` + // 与 beforeRouteUpdate 相同,无法访问 `this` onBeforeRouteUpdate(async (to, from) => { //仅当 id 更改时才获取用户,例如仅 query 或 hash 值已更改 if (to.params.id !== from.params.id) {