How to set up vue-router in batches? there are too many import for hundreds of pages one by one.

//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?

Mar.20,2021

mention require.context again. Just put the corresponding file according to a certain structure. You can change the routing definition appropriately to support lazy loading

.
  

first of all, if there is this feature, the official documents will definitely mention it and have a detailed tutorial
. Secondly, it is really a system with hundreds of pages, and using Vue is not so suitable for
finally, let's import it one by one. Anyway, I don't know what method Vue provides to import so many files at once

.
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b2b4f3-2ba82.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b2b4f3-2ba82.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?