//router.js
import Router from "vue-router"
import Vue from "vue"
import login from "./components/views/login"
import chat from "./components/views/chat"
import App from "./index"
Vue.use(Router)
export default new Router({
mode: "abstract",
routes: [
{ path: "/login",component:login},
{ path:"/chat",component:chat},
{ path:"/",component:App}
]
})
for example, if there are only three pages above, you need to import three times, and below routes you need to write three mappings.
if it"s a system with hundreds of pages, don"t you want to write about dead people?