当前位置:网站首页>If the route reports an error after deployment according to the framework project
If the route reports an error after deployment according to the framework project
2022-04-23 05:20:00 【Lora_ 0925】
If deployed to the server according to the framework , Dynamic routing error reporting , cannot access , The reason is that some versions do not support dynamic import Import
solve : find /store/modules/permission.js, take import The introduction is changed to require
export const loadView = (view) => {
return (resolve) => require([`@/views/${view}`], resolve)
}
primary :
export const loadView = (view) => {
if (process.env.NODE_ENV === 'development') {
return (resolve) => require([`@/views/${view}`], resolve)
} else {
// Use import Realize the routing lazy loading of production environment
return () => import(`@/views/${view}`)
}
}
版权声明
本文为[Lora_ 0925]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204220546439548.html
边栏推荐
- Open source rule engine - Ice: dedicated to solving flexible and complex hard coding problems
- egg的static的前缀是可以修改惹,靴靴
- MySQL external connection, internal connection, self connection, natural connection, cross connection
- 2021-10-25
- JS array common methods
- Study notes: unity customsrp-12-hdr
- egg测试的知识大全--mock、superTest、coffee
- Streamexecutionenvironment of Flink source code
- MySQL realizes row to column SQL
- When is it appropriate for automated testing? (bottom)
猜你喜欢

At pgconf Asia Chinese technology forum, listen to Tencent cloud experts' in-depth understanding of database technology

Data security has become a hidden danger. Let's see how vivo can make "user data" armor again

Publish your own wheel - pypi packaging upload practice

Laravel database

Simple application of parallel search set (red alarm)

Kanban Quick Start Guide

2021-11-08

Summary of MySQL knowledge points

To understand Devops, you must read these ten books!

Graphics. Fromimage reports an error "graphics object cannot be created from an image that has an indexed pixel..."
随机推荐
Blender programmed terrain production
Three 之 three.js (webgl)旋转属性函数的简单整理,以及基于此实现绕轴旋转的简单案例
4 个最常见的自动化测试挑战及应对措施
!!!!!!!!!!!!!!!!!!
日志简介和构建web应用
Redis data type usage scenario
领域驱动模型DDD(三)——使用Saga管理事务
At pgconf Asia Chinese technology forum, listen to Tencent cloud experts' in-depth understanding of database technology
The annual transaction volume of the app store is US $1 million, and only 15% commission is paid. Small and medium-sized developers are very contradictory
Minimum spanning tree -- unblocked project hdu1863
Laravel routing job
WTL self drawn control library (cqscheckcomboxbox)
Data security has become a hidden danger. Let's see how vivo can make "user data" armor again
史上最强egg框架的error处理机制
When is it appropriate for automated testing? (bottom)
Blender程序化地形制作
看板快速启动指南
Unique primary key ID of tidb sub table -- solution to failure of sequence and Gorm to obtain primary key
node中的redis使用--ioredis
Kanban Quick Start Guide