From 10dafc913496811d3b7c1337a1da53b8105f5e6d Mon Sep 17 00:00:00 2001 From: zyxm5 <36184564+zyxm5@users.noreply.github.com> Date: Thu, 16 Sep 2021 17:26:00 +0800 Subject: [PATCH] Update caveats.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 在constructor中使用异步函数,只是被调用一次 --- docs/guide/caveats.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/guide/caveats.md b/docs/guide/caveats.md index 6b26be3..6687988 100644 --- a/docs/guide/caveats.md +++ b/docs/guide/caveats.md @@ -64,7 +64,7 @@ export default class Posts extends Vue { } ``` -The above code intends to fetch post list on component initialization but the fetch will be called twice unexpectedly because of how Vue Class Component works. +The above code intends to fetch post list on component initialization but the fetch will be called once unexpectedly because of how Vue Class Component works. It is recommended to write lifecycle hooks such as `created` instead of `constructor`: @@ -85,4 +85,4 @@ export default class Posts extends Vue { }) } } -``` \ No newline at end of file +``` pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy