feat: Migrate to Nuxt 3 framework (#5184)

Co-authored-by: Michael Genson <71845777+michael-genson@users.noreply.github.com>
Co-authored-by: Kuchenpirat <24235032+Kuchenpirat@users.noreply.github.com>
This commit is contained in:
Hoa (Kyle) Trinh
2025-06-20 00:09:12 +07:00
committed by GitHub
parent 89ab7fac25
commit c24d532608
403 changed files with 23959 additions and 19557 deletions

View File

@@ -1,19 +1,18 @@
import { ref, reactive, Ref } from "@nuxtjs/composition-api";
import { useReadOnlyActions, useStoreActions } from "./use-actions-factory";
import { BoundT } from "./types";
import { BaseCRUDAPI, BaseCRUDAPIReadOnly } from "~/lib/api/base/base-clients";
import { QueryValue } from "~/lib/api/base/route";
import type { BoundT } from "./types";
import type { BaseCRUDAPI, BaseCRUDAPIReadOnly } from "~/lib/api/base/base-clients";
import type { QueryValue } from "~/lib/api/base/route";
export const useData = function<T extends BoundT>(defaultObject: T) {
export const useData = function <T extends BoundT>(defaultObject: T) {
const data = reactive({ ...defaultObject });
function reset() {
Object.assign(data, defaultObject);
};
return { data, reset };
}
};
export const useReadOnlyStore = function<T extends BoundT>(
export const useReadOnlyStore = function <T extends BoundT>(
store: Ref<T[]>,
loading: Ref<boolean>,
api: BaseCRUDAPIReadOnly<T>,
@@ -36,9 +35,9 @@ export const useReadOnlyStore = function<T extends BoundT>(
}
return { store, actions };
}
};
export const useStore = function<T extends BoundT>(
export const useStore = function <T extends BoundT>(
store: Ref<T[]>,
loading: Ref<boolean>,
api: BaseCRUDAPI<unknown, T, unknown>,
@@ -61,4 +60,4 @@ export const useStore = function<T extends BoundT>(
}
return { store, actions };
}
};