中维商城 中维商城
首页
  • 闲置仓库

    • 入驻商户手册
    • 平台操作手册
  • 智能检测工装

    • 主板智能检测
    • LG逻辑板技改
    • D07逻辑板技改
    • 数据采集
    • 空调烧录
    • 冰箱烧录
  • 前端文章

    • JavaScript
  • 学习笔记

    • 《JavaScript教程》
    • 《JavaScript高级程序设计》
    • 《ES6 教程》
    • 《Vue》
    • 《React》
    • 《TypeScript 从零实现 axios》
    • 《Git》
    • TypeScript
    • JS设计模式总结
GitHub (opens new window)

四川百库科技有限公司

维修是我,中维商城(www.wx45.com)
首页
  • 闲置仓库

    • 入驻商户手册
    • 平台操作手册
  • 智能检测工装

    • 主板智能检测
    • LG逻辑板技改
    • D07逻辑板技改
    • 数据采集
    • 空调烧录
    • 冰箱烧录
  • 前端文章

    • JavaScript
  • 学习笔记

    • 《JavaScript教程》
    • 《JavaScript高级程序设计》
    • 《ES6 教程》
    • 《Vue》
    • 《React》
    • 《TypeScript 从零实现 axios》
    • 《Git》
    • TypeScript
    • JS设计模式总结
GitHub (opens new window)
  • 基础

  • 组件

  • 过渡&动画

  • 可复用性&组合

  • 工具

  • 规模化

    • vuex操作相关
    • 路由懒加载
  • Vuex

  • 其他

  • 《Vue》笔记
  • 规模化
xugaoyi
2020-02-04

路由懒加载

# 路由懒加载

// 路由同步加载
// import Recommend from '@/components/recommend/recommend'
// import Singer from '@/components/singer/singer'
// import Rank from '@/components/rank/rank'
// import Search from '@/components/search/search'
// import SingerDetail from '@/components/singer-detail/singer-detail'
// import Disc from '@/components/disc/disc'
// import TopList from '@/components/top-list/top-list'
// import UserCenter from '@/components/user-center/user-center'

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')

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22

使用路由懒加载可使app.js文件变小,进入不同路由在分别加载该路由的js。

编辑 (opens new window)
#Vue
上次更新: 2024/08/16, 10:00:45
vuex操作相关
Vuex

← vuex操作相关 Vuex→

最近更新
01
冰箱烧录
06-16
02
空调烧录
04-17
03
数据采集
04-17
更多文章>
Theme by Vdoing | Copyright © 2024-2026 四川百库科技有限公司 | ICP备案:蜀ICP备14002648号-1
  • 跟随系统
  • 浅色模式
  • 深色模式
  • 阅读模式