項目中需根據后臺接口,給當前登錄人動態生成菜單欄。我的做法是獲取接口數據后,遍歷數據 動態push router問題出在動態push router時 menu.component = lazyLoading(menu.component); //menu.component時接口返回的一級菜單的資源路徑 例如 有一個頁面叫myTestListmenu.component = ‘test/myTestList’然后我用lazyLoading import 對應的.vue頁面資源//lazyLoadingexport default (url) =>()=>import(@/views/${url}.vue)一開始 項目中頁面比較少,現在對應的.vue差不多有80個左右,我發現熱更新時間特別久,每次修改一個字符串,都要等待幾分鐘。求教問題出在哪里?怎么解決這種問題呢?
添加回答
舉報
0/150
提交
取消