Easy Loading Screens with Vue Suspense Components

Jason
Sep 21, 2022

--

子層

製作模擬延遲 3 秒的 async function

現在去父層

  1. 放入 async component
  2. 放入 async component 還沒跑完的預設 component
  3. 全部用 Suspense 包起來

如果子層元件 fetch data有 error 出現,使用 onErrorCaptured 抓取

印出 error message

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

Jason
Jason

Written by Jason

Nothing is true, everything is permitted.

No responses yet

Write a response