vue精要(6)-性能优化
# 1.syntax-dynamic-import插件实现懒加载
// npm install @babel/plugin-syntax-dynamic-import babel-plugin-component --save-dev
// yarn add @babel/plugin-syntax-dynamic-import babel-plugin-component --dev
// babel.config.js
module.exports = {
"presets": [
"@vue/app"
],
"plugins": [
[
"component",
{
"libraryName": "element-ui",
"styleLibraryName": "theme-chalk"
},
"syntax-dynamic-import"
]
]
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18