优化体验
This commit is contained in:
		| @@ -1,7 +1,7 @@ | ||||
| import store from "../store"; | ||||
| import appEntry from "../views/appEntry"; | ||||
| import {waiting} from "../utils"; | ||||
|  | ||||
| import router from "./router"; | ||||
| export default { | ||||
|   routes: [], | ||||
|   init() { | ||||
| @@ -31,6 +31,7 @@ export default { | ||||
|               } | ||||
|           //命名规范入口文件必须以App开头 | ||||
|           waiting.setContent(`加载${name}...`) | ||||
|           router.addRoute(addApp) | ||||
|           this.routes.push(addApp) | ||||
|           return store.commit("addApp", addApp) | ||||
|         }) | ||||
|   | ||||
| @@ -1,22 +1,18 @@ | ||||
| import Vue from 'vue' | ||||
| import VueRouter from 'vue-router' | ||||
| import autoRoutes from './autoRoutes' | ||||
| import Vue from "vue"; | ||||
|  | ||||
| autoRoutes.init() | ||||
| Vue.use(VueRouter) | ||||
|  | ||||
| export default autoRoutes.init().then(() => new VueRouter({ | ||||
| export default new VueRouter({ | ||||
|   mode: 'history', | ||||
|   hashbang: false, | ||||
|   routes: [ | ||||
|     {path: "/", name: "产品库"}, | ||||
|     ...autoRoutes.routes | ||||
|   ], | ||||
|   routes: [{path: "/", name: "产品库",component:import('../App')}], | ||||
|   scrollBehavior(to) { | ||||
|     console.log(to) | ||||
|     if (to.hash) { | ||||
|       return { | ||||
|         selector: to.hash | ||||
|       } | ||||
|     } | ||||
|   } | ||||
| })) | ||||
| }) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user