Mode problem of vue-router

there are three div, corresponding to three js files in one page. Set the route for their joining.

clipboard.png

js

clipboard.png


clipboard.png

modehash;

clipboard.png

what is the difference between the specific settings of this mode? why can"t it be displayed normally when it is set to history?

Mar.09,2021

Let me guess that because the third is set to history mode, the page address becomes an address without-sharp (although there are three vue instances, but the history api), of the same page whose routes are all operated does not see what the error net::ERR_ABORTED is, it leads to an error in loading js or resolving routes in the first two (still parsed according to hash).

ip:8080/-sharp/index/123
ip:8080/index/123

the relative path addresses under the two paths are not the same, and for . / app.js , they are

, respectively.
ip:8080/app.js
ip:8080/index/123/app.js

later, it is found that when the mode of multiple routes is different, the route for history can be set to

in mode.

mode:'history',
base:__dirname,

at this time, all routes will be displayed normally, but the route will not work when naming the view, or the above problem will occur
and a new problem will be found:
set the named view as above,

const router=new VueRouter({
    mode:'history',
    base:__dirname,
    routes:[
       {
           path:'/settings',
           component:Levelone,
           children:[
           {
              path:'emails',
              component:Levelthree
           },
           {
              path:'profile',
              components:{
                  default:Levelfour,
                  helper:Levelfive
              }
           }
           ]
       }
    ]
})

when the statement router.push ('/ settings/emails') is not written, other routes on the page display normally

clipboard.png

but the route for this named view cannot be displayed on the page, but the initial error occurs when writing the statement router.push ('/ settings/emails'). Why?

Menu