路由如果是异步加载的怎么写呢
Closed this issue · 1 comments
huangjincq commented
路由如果是异步加载的怎么写呢
huangjincq commented
const components = require.context('@/components', true, /[A-Z]\w+.(vue)$/, 'lazy');
components.keys().forEach(filePath => {
// load the component
components(filePath).then(module => {
// module.default is the vue component
console.log(module.default);
});
});