migrate two column list item selection sheet to composition API and typescript

This commit is contained in:
MaysWind
2025-01-14 00:38:15 +08:00
parent 30125f0faa
commit 8ce871e9bb
3 changed files with 118 additions and 110 deletions
+7 -2
View File
@@ -77,6 +77,7 @@ import { KnownErrorCode, SPECIFIED_API_NOT_FOUND_ERRORS, PARAMETERIZED_ERRORS }
import type { LatestExchangeRateResponse, LocalizedLatestExchangeRate } from '@/models/exchange_rate.ts';
import {
isDefined,
isObject,
isString,
isNumber,
@@ -478,8 +479,12 @@ export function useI18n() {
}
// public functions
function translateIf(text: string, isTranslate: boolean): string {
if (isTranslate) {
function translateIf(text: string | undefined, isTranslate: boolean): string | undefined {
if (!isDefined(text)) {
return undefined;
}
if (text && isTranslate) {
return t(text);
}