请问vuerouter4与vueroute3的区别?
网友回复
1、创建方式
4.x用法
createRouter
用来创建router对象
import { createRouter } from "vue-router" const router = createRouter({options })3.x用法
import VueRouter from "vue-router"' const router = new VueRouter({ // options ...... })
2、路由模式
4.x用法
createWebHashHistory (hash)
createWebHashHistory (history)import { createRouter, createWebHashHistory, createWebHashHistory } from 'vue-router' const router = createRouter({ history:createWebHashHistory() // createWebHashHistory() })
3.x用法
const router = new VueR...
点击查看剩余70%