keep-alive
组件切换时,缓存组件,保持组件时的状态,避旬反复渲染导致性能问题
在 Vue 是一个组件 <keep-alive></keep-alive>
动态组件
在交互中,组件的渲染是不确定的、根据交互的操作来关键字来渲染哪个组件
在 Vue 是一个组件 <component :is=""></component> 使用 is props 来指定组件
异步组件
没有必要在当前进行加载的组件
被分割成代码块文件,按需从服务器上下载并加载
Vue2
AsyncComp: () => import('./xxxxx')
Vue3
必需使用 defineAsyncComponent 定义异步组件
AsyncComp: defineAsyncComponent(() =>new Promise((resolve, reject) => {resolve({data () {return {xxxx}},template: ``});})
AsyncComp: Vue.definAsyncComponent(() => import('./xxx'))
