vue vue-router路由模式有几种

vue里面的vue-router路由模式有几种?

  有三种hash、history、abstract

示例:

switch (mode) {
  case 'history':
    this.history = new HTML5History(this, options.base)
    break
  case 'hash':
    this.history = new HashHistory(this, options.base, this.fallback)
    break
  case 'abstract':
    this.history = new AbstractHistory(this, options.base)
    break
  default:
    if (process.env.NODE_ENV !== 'production') {
      assert(false, `invalid mode: ${mode}`)
    }
}

 

 

枝上柳绵吹又少,天涯何处无芳草

posted @ 2023-03-05 17:05  方达达  阅读(3)  评论(0编辑  收藏  举报