From 66eceb08eddd8cdf40f3389d3f34721ed2b224e4 Mon Sep 17 00:00:00 2001 From: halfcoke Date: Sat, 25 Nov 2023 14:46:37 +0800 Subject: [PATCH] feat(i18n): json to toml --- src/composable/validation.ts | 3 +-- src/tools/json-to-toml/json-to-toml.vue | 11 ++++++----- src/tools/json-to-toml/locales/en.yml | 9 +++++++++ src/tools/json-to-toml/locales/zh.yml | 9 +++++++++ 4 files changed, 25 insertions(+), 7 deletions(-) create mode 100644 src/tools/json-to-toml/locales/en.yml create mode 100644 src/tools/json-to-toml/locales/zh.yml diff --git a/src/composable/validation.ts b/src/composable/validation.ts index 472ca4b2..bae798c0 100644 --- a/src/composable/validation.ts +++ b/src/composable/validation.ts @@ -6,7 +6,7 @@ type ValidatorReturnType = unknown; export interface UseValidationRule { validator: (value: T) => ValidatorReturnType - message: string + message: any } export function isFalsyOrHasThrown(cb: () => ValidatorReturnType): boolean { @@ -56,7 +56,6 @@ export function useValidation({ watch( [source, ...watchRefs], () => { - state.message = ''; state.status = undefined; for (const rule of get(rules)) { diff --git a/src/tools/json-to-toml/json-to-toml.vue b/src/tools/json-to-toml/json-to-toml.vue index b1d37a38..685053f4 100644 --- a/src/tools/json-to-toml/json-to-toml.vue +++ b/src/tools/json-to-toml/json-to-toml.vue @@ -1,9 +1,10 @@