VueRouter - V4
Hash 模式
import { createRouter, createWebHashHistory } from 'vue-router'
const router = createRouter({
history: createWebHashHistory(),
routes: [
],
})
HTML5 模式
import { createRouter, createWebHistory } from 'vue-router'
const router = createRouter({
history: createWebHistory(),
routes: [
],
})
VueRouter - V3
Hash 模式
import { VueRouter } from 'vue-router'
const router = new VueRouter({
mode: 'history',
routes: [...]
})
HTML5 模式
import { VueRouter } from 'vue-router'
const router = new VueRouter({
mode: 'hash',
routes: [...]
})