vue性能优化的方法

1、路由懒加载

const router = new VueRouter({ routes:[{ path: './ment', component: () => import('./ment.vue') }] })

2、keep-alive 缓存页面

【vue性能优化的方法】3、使用v-show来复用Dom

4、v-for 中避免同时使用 v-if
5、图片懒加载 v-lazy
6、第三方插件按需引入
import {select,input} from 'element-ui' Vue.use(select) Vue.use(input)

7、无状态组件标记成函数组件

8、子组件分割

    推荐阅读