📝 Update RoadSign docs

This commit is contained in:
2024-10-04 17:55:42 +08:00
parent 92e56e7e88
commit a0cf66d2e1
7 changed files with 104 additions and 15 deletions

View File

@ -40,7 +40,7 @@
<v-divider class="border-opacity-50 mb-4 mt-0.5" />
<copyright no-centered service="capital" class="px-5" />
<copyright no-centered :service="['roadsign', 'capital']" class="px-5" />
<footer-links class="px-5 mt-3" />
</v-navigation-drawer>

View File

@ -72,13 +72,20 @@ const breadcrumb = computed(() => {
})
const navNotRoot = computed(() => route.path.split("/").length > 2)
const navQuery = computed(() => ({
where: {
_path: new RegExp("^\\/" + route.path.replace(/^\/|\/$/g, "") + "\\/[^\\/]+\\/?$"),
_locale: getLocale(locale),
},
}))
console.log(navQuery.value)
const navQuery = ref(calcNavQuery())
function calcNavQuery(path?: string) {
return {
where: {
_path: new RegExp("^\\/" + (path ?? route.path).replace(/^\/|\/$/g, "") + "\\/[^\\/]+\\/?$"),
_locale: getLocale(locale),
},
}
}
watch(route, (value) => {
navQuery.value = calcNavQuery(value.path)
}, { immediate: true, deep: true })
function previousNav() {
const arr = route.path.split("/")