Vue 2.0 高级实战-开发移动端音乐WebApp 课程笔记(第13章 编译打包)
编译打包-项目编译打包及node服务测试
1 | let express = require('express') |
编译打包-路由组件实现懒加载
修改router1
2
3
4
5
6
7
8const Recommend = () => import('components/recommend/recommend')
const Singer = () => import('components/singer/singer')
const Rank = () => import('components/rank/rank')
const Search = () => import('components/search/search')
const SingerDetail = () => import('components/singer-detail/singer-detail')
const Disc = () => import('components/disc/disc')
const TopList = () => import('components/top-list/top-list')
const UserCenter = () => import('components/user-center/user-center')
总结
- 学习的价值不在于获得源码
- 组件化、模块化的本质都是分治(把复杂的项目拆分成一个个模块, 把模块拆分成组件, 把能复用的功能都抽象出js文件)
- 遇到问题要勇于面对、勤于思考
- 学会主动学习