mirror of
https://github.com/dataease/dataease.git
synced 2025-02-23 11:03:04 +08:00
fix(嵌入式): 嵌入式路由调整
This commit is contained in:
parent
8e57e7f9f9
commit
e84d8bc860
@ -3,31 +3,22 @@ import type { RouteRecordRaw } from 'vue-router'
|
||||
import type { App } from 'vue'
|
||||
|
||||
export const routes: AppRouteRecordRaw[] = []
|
||||
createRouter({
|
||||
const router = createRouter({
|
||||
history: createWebHashHistory(),
|
||||
routes: routes as RouteRecordRaw[]
|
||||
})
|
||||
const fn = () => {
|
||||
console.log('push')
|
||||
}
|
||||
|
||||
const router = {
|
||||
install: () => {
|
||||
console.log('install')
|
||||
},
|
||||
currentRoute: fn,
|
||||
listening: true,
|
||||
addRoute: fn,
|
||||
removeRoute: fn,
|
||||
hasRoute: fn,
|
||||
getRoutes: fn,
|
||||
resolve: fn,
|
||||
options: fn,
|
||||
push: fn,
|
||||
replace: fn,
|
||||
go: fn,
|
||||
back: fn,
|
||||
forward: fn
|
||||
const rawInstall = router.install
|
||||
router.install = app => {
|
||||
const hash = window.location.hash
|
||||
console.log('hash', hash)
|
||||
rawInstall(app)
|
||||
console.log('hash1', window.location.hash)
|
||||
setTimeout(() => {
|
||||
console.log('hash2', window.location.hash)
|
||||
}, 300)
|
||||
window.location.hash = hash
|
||||
console.log('hash3', window.location.hash)
|
||||
}
|
||||
|
||||
export const setupRouter = (app: App<Element>) => {
|
||||
|
Loading…
Reference in New Issue
Block a user