Merge remote-tracking branch 'origin/develop' into develop

develop
admin 2024-11-18 15:21:52 +08:00
commit 4176805099
1 changed files with 4 additions and 0 deletions

View File

@ -10,6 +10,7 @@ import { unref } from 'vue'
import { useStore } from 'vuex'
import { useRoute } from 'vue-router'
import { pathToRegexp } from 'path-to-regexp'
import { isExternalLink } from 'utils/resolvePath'
export default function () {
const store = useStore()
@ -20,6 +21,9 @@ export default function () {
const item = unref(routeMap)[route.path]
if (item) return item
for (const path in unref(routeMap)) {
if (isExternalLink(path)) {
continue
}
const reg = pathToRegexp(path)
if (reg.exec(route.path)) {
return unref(routeMap)[path]