Initial commit

This commit is contained in:
chinahu-woker
2025-03-04 16:26:53 +08:00
parent 680597131b
commit b7b4b3b69c
24 changed files with 135 additions and 18 deletions
+7 -1
View File
@@ -8562,9 +8562,15 @@ function defineStore(idOrOptions, setup, setupOptions) {
let id;
let options;
const isSetupStore = typeof setup === "function";
{
if (typeof idOrOptions === "string") {
id = idOrOptions;
options = isSetupStore ? setupOptions : setup;
} else {
options = idOrOptions;
id = idOrOptions.id;
if (typeof id !== "string") {
throw new Error(`[🍍]: "defineStore()" must be passed a store id as its first argument.`);
}
}
function useStore(pinia, hot) {
const hasContext = hasInjectionContext();