路由懒加载,test环境出现警告
routerArr.push({
path: path == "home" ? '/' :'/'+path,//home 默认为根组件
name: componentName,
component: process.env.NODE_ENV == 'test' ? () => require(/* webpackChunkName: "alarm" / ../views${componentLocation}
) : () => import(/ webpackChunkName: "alarm" */ ../views${componentLocation}
)
})
[Vue Router warn]: Component "default" in record with path "/" is a function that does not return a Promise. If you were passing a functional component, make sure to add a "displayName" to the component. This will break in production if not fixed.
去掉警告