code refactor

This commit is contained in:
MaysWind
2025-01-11 13:59:47 +08:00
parent 61f26e060e
commit 89b233e51b
25 changed files with 128 additions and 128 deletions
+5 -5
View File
@@ -9,20 +9,20 @@
</template>
<script setup lang="ts">
import { type Ref, ref, watch } from 'vue';
import { ref, watch } from 'vue';
import { useI18n } from '@/locales/helpers.ts';
import { isObject } from '@/lib/common.ts';
const emit = defineEmits<{
(e: 'update:show', value: boolean): void
(e: 'update:show', value: boolean): void;
}>();
const { tt, te } = useI18n();
const showState: Ref<boolean> = ref(false);
const messageContent: Ref<string> = ref('');
const showState= ref<boolean>(false);
const messageContent = ref<string>('');
function showMessage(message: string, options: Record<string, unknown>): void {
showState.value = true;
@@ -35,7 +35,7 @@ function showError(error: string | { message: string }): void {
if (isObject(error) && (error as { message: string }).message) {
messageContent.value = te((error as { message: string }).message);
} else {
messageContent.value = te(error);
messageContent.value = te(error as string);
}
}