1、同步
1、 import Page from '@/components/page'
2、异步
-
const Page = () => import('@/components/page')
-
const Page = resolve => require(['@/components/page'], page)
3、生命周期执行顺序
同步引入时生命周期顺序为:父组件的beforeCreate、created、beforeMount --> 所有子组件的beforeCreate、created、beforeMount --> 所有子组件的mounted --> 父组件的mounted
异步引入时生命周期顺序:父组件的beforeCreate、created、beforeMount、mounted --> 子组件的beforeCreate、created、beforeMount、mounted