vue异步加载组件

1、通常我们这样加载组件,

import JobNumInformation from "@/components/views/order-center/orderlist/JobNumInformation"

然后在components中注册下,这样我们就可以在当前页面使用这个组件了

components{

JobNumInformation

}

2、延迟加载组件:在我们要使用组件时才加载该组件

vue异步加载组件

使用() => import('JobNumInformation from "@/components/views/order-center/orderlist/JobNumInformation"')替代前面示例中的import JobNumInformation from "@/components/views/order-center/orderlist/JobNumInformation"。Vue一旦请求渲染将会延迟加载该组件。 

vue异步加载组件

vue异步加载组件

vue异步加载组件