This commit is contained in:
zyronon
2024-05-30 18:53:26 +08:00
parent 81aa82b609
commit b9a35f5c6d
8 changed files with 118 additions and 134 deletions

View File

@@ -5,6 +5,7 @@ import {cloneDeep} from "lodash-es";
import {Dict, DictType} from "@/types.ts";
import {ArchiveReader, libarchiveWasm} from "libarchive-wasm";
import {useRouter} from "vue-router";
import {useRuntimeStore} from "@/stores/runtime.ts";
export function getRandom(a: number, b: number): number {
return Math.random() * (b - a) + a;
@@ -190,11 +191,12 @@ export function getDictFile(url: string) {
export function useNav() {
const router = useRouter()
const runtimeStore = useRuntimeStore()
function nav(path, query = {}, data?: any) {
// if (data) {
// store.routeData = cloneDeep(data)
// }
if (data) {
runtimeStore.routeData = cloneDeep(data)
}
router.push({path, query})
}