路由懒加载
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
|
Vue.use(Router)
const 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')
|
使用路由懒加载可使app.js文件变小,进入不同路由在分别加载该路由的js。