vue-router routing mode in several?

  In fact there are three modes:

  Hash: using the hash value of the URL as routing. Support all browsers.

  History: Since HTML5 History API and server configuration. Refer to the official website HTML5 History mode

  Abstract: javascript support for all operating modes. If the API is not browser-discovery, routing automatically forced into this mode.

 

 vue-router using the default hash mode , that is, the URL will appear as follows: , the URL with a #

 We use the following code can be modified to model history :

import Vue from 'vue'
import Router from 'vue-router'
import Main from '@/components/Main'
Vue.use(Router)

export default new Router({
  mode: 'history',
  routes: [
    {
      path: '/',
      component: Main
    }
  ]
})

 

Guess you like

Origin www.cnblogs.com/Rivend/p/12629097.html