亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

如何知道動態組件何時完全加載

如何知道動態組件何時完全加載

慕村9548890 2021-06-29 21:01:19
所以我正在像這樣動態加載一些組件:const Page0 = () => import("@/components/pages/tutorial/Pages/Page0")const Page1 = () => import("@/components/pages/tutorial/Pages/Page1")還有 10 個這樣的頁面,將根據路由參數調用它們。我想知道我如何知道某個頁面是否已加載,以創建加載屏幕,以及我如何知道它何時被切換。這就是我完全使用它的方式。<template>    <div>        <component :is="current_page"></component>    </div></template><script>    const Page0 = () => import("@/components/pages/tutorial/Pages/Page0/index.vue")    const Page1 = () => import("@/components/pages/tutorial/Pages/Page1/index.vue")    export default {        scrollToTop:            true,        components:            {                Page0,                Page1,            },        computed:            {                current_page ()                {                    return "Page" + this.page                }            },        asyncData ({            route, store, env, params, query, req, res, redirect, error        })        {            return {                page:                    params.page            }        }    }</script>
查看完整描述

1 回答

  • 1 回答
  • 0 關注
  • 146 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號