通过improt xxx from xxx 的方式加载组件,无论组件有没有被用到,都会被加载进来
实现Vue组件的按需加载
const 组件名 = (resolve) => {
import(’…/views/组件名’).then((module) => {
resolve(module)
})
}
通过improt xxx from xxx 的方式加载组件,无论组件有没有被用到,都会被加载进来
实现Vue组件的按需加载
const 组件名 = (resolve) => {
import(’…/views/组件名’).then((module) => {
resolve(module)
})
}