code refactor

This commit is contained in:
MaysWind
2025-01-21 23:47:22 +08:00
parent e053528abf
commit 58097331da
12 changed files with 19 additions and 56 deletions
@@ -55,9 +55,7 @@ const { tt } = useI18n();
const currentValue = ref<ColorValue>(props.modelValue);
const itemPerRow = ref<number>(props.columnCount || 7);
const allColorRows = computed<ColorInfo[][]>(() => {
return getColorsInRows(props.allColorInfos, itemPerRow.value);
});
const allColorRows = computed<ColorInfo[][]>(() => getColorsInRows(props.allColorInfos, itemPerRow.value));
function onColorClicked(colorInfo: ColorInfo): void {
currentValue.value = colorInfo.color;
@@ -109,9 +109,7 @@ const isDarkMode = computed<boolean>(() => environmentsStore.framework7DarkMode
const firstDayOfWeek = computed<number>(() => userStore.currentUserFirstDayOfWeek);
const dayNames = computed<string[]>(() => arrangeArrayWithNewStartIndex(getAllMinWeekdayNames(), firstDayOfWeek.value));
const isYearFirst = computed<boolean>(() => isLongDateMonthAfterYear());
const displayTime = computed<string>(() => {
return formatUnixTimeToLongDateTime(getActualUnixTimeForStore(getUnixTime(dateTime.value), getTimezoneOffsetMinutes(), getBrowserTimezoneOffsetMinutes()));
});
const displayTime = computed<string>(() => formatUnixTimeToLongDateTime(getActualUnixTimeForStore(getUnixTime(dateTime.value), getTimezoneOffsetMinutes(), getBrowserTimezoneOffsetMinutes())));
const switchButtonTitle = computed<string>(() => mode.value === 'time' ? 'Date' : 'Time');
function switchMode(): void {
+1 -3
View File
@@ -56,9 +56,7 @@ const { tt } = useI18n();
const currentValue = ref<string>(props.modelValue);
const itemPerRow = ref<number>(props.columnCount || 7);
const allIconRows = computed<IconInfoWithId[][]>(() => {
return getIconsInRows(props.allIconInfos, itemPerRow.value);
});
const allIconRows = computed<IconInfoWithId[][]>(() => getIconsInRows(props.allIconInfos, itemPerRow.value));
const heightClass = computed<string>(() => {
if (allIconRows.value.length > 10) {
+1 -3
View File
@@ -50,9 +50,7 @@ const { tt } = useI18n();
const currentPinCode = ref<string>('');
const currentPinCodeValid = computed<boolean>(() => {
return currentPinCode.value?.length === 6 || false;
});
const currentPinCodeValid = computed<boolean>(() => currentPinCode.value?.length === 6 || false);
function confirm(): void {
if (!currentPinCodeValid.value || props.confirmDisabled) {