@anweb/nuxt-ancore 1.13.0 → 1.13.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/module.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "AnCore",
3
3
  "configKey": "ancore",
4
- "version": "1.13.0",
4
+ "version": "1.13.2",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "3.6.1"
@@ -8,7 +8,7 @@ export const useAnForm = (params, data) => {
8
8
  Object.fromEntries(
9
9
  Object.entries(params).map(([k, v]) => {
10
10
  const key = k;
11
- return [key, data?.[key] ?? v.default];
11
+ return [key, data?.[key] !== void 0 ? data?.[key] : v.default];
12
12
  })
13
13
  )
14
14
  );
@@ -17,19 +17,6 @@ export const useAnForm = (params, data) => {
17
17
  const History = useRefHistory(state, { deep: true });
18
18
  const errors = ref({});
19
19
  const init = () => {
20
- if (data) merge(data);
21
- initValidate();
22
- void nextTick(History.clear);
23
- };
24
- const merge = (data2, commit) => {
25
- for (const key of keys) {
26
- state.value[key] = data2[key];
27
- }
28
- if (commit) {
29
- void nextTick(History.clear);
30
- }
31
- };
32
- const initValidate = () => {
33
20
  const rules = {};
34
21
  for (const key of keys) {
35
22
  if (!params[key].rules) continue;
@@ -51,6 +38,14 @@ export const useAnForm = (params, data) => {
51
38
  }
52
39
  });
53
40
  };
41
+ const merge = (data2, commit) => {
42
+ for (const key of keys) {
43
+ state.value[key] = data2[key];
44
+ }
45
+ if (commit) {
46
+ void nextTick(History.clear);
47
+ }
48
+ };
54
49
  const first = computed(() => {
55
50
  return History.history.value.at(-1)?.snapshot;
56
51
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@anweb/nuxt-ancore",
3
- "version": "1.13.0",
3
+ "version": "1.13.2",
4
4
  "description": "AnCore Nuxt module",
5
5
  "repository": "https://github.com/ANLTD/ancore",
6
6
  "license": "MIT",
@@ -32,19 +32,19 @@
32
32
  "release:major": "npm run prepack && changelogen --major --release && npm publish --access public && git push --follow-tags"
33
33
  },
34
34
  "dependencies": {
35
- "@nuxt/kit": "^4.2.0",
35
+ "@nuxt/kit": "^4.2.1",
36
36
  "@vueuse/core": "^14.0.0",
37
37
  "@vueuse/integrations": "^14.0.0",
38
38
  "async-validator": "^4.2.5",
39
- "i18next": "^25.6.0"
39
+ "i18next": "^25.6.2"
40
40
  },
41
41
  "devDependencies": {
42
- "@nuxt/devtools": "^3.0.0",
42
+ "@nuxt/devtools": "^3.1.0",
43
43
  "@nuxt/module-builder": "^1.0.2",
44
- "@nuxt/schema": "^4.2.0",
44
+ "@nuxt/schema": "^4.2.1",
45
45
  "@types/node": "latest",
46
46
  "changelogen": "^0.6.2",
47
- "nuxt": "^4.2.0",
47
+ "nuxt": "^4.2.1",
48
48
  "typescript": "~5.9.3"
49
49
  }
50
50
  }