1.适用场景:所有通过router路由的单页应用. 2.示例代码:本文以vue-router为例. 在router.js中: let router = new Router({ routes: [ { path: '/', title: '', redirect: '/chooseCity' }, { path: '/login', title: '', component: resolve => require(['components/login/login.vue'], resolve)…