dev: hotfix, nav-footer, button, dialog

This commit is contained in:
2025-10-28 15:40:41 +07:00
parent 0504712559
commit 3e7e735ae4
19 changed files with 493 additions and 144 deletions
+32
View File
@@ -0,0 +1,32 @@
import { useRoute, useRouter } from 'vue-router'
export function useQueryParam(key: string = 'mode') {
const route = useRoute()
const router = useRouter()
const getQueryParam = (key: string) => {
return route.query[key]
}
const setQueryParam = (key: string, val: string) => {
router.replace({
path: route.path,
query: {
...route.query,
[key]: val === 'list' ? undefined : val,
},
})
}
const setQueryParams = (keyVal: Record<string, string>) => {
router.replace({
path: route.path,
query: {
...route.query,
...keyVal,
},
})
}
return { getQueryParam, setQueryParam, setQueryParams}
}