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
+1 -3
View File
@@ -72,9 +72,7 @@ const icons = {
const dropdownMenu = useTemplateRef<HTMLElement>('dropdownMenu');
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));
const color = computed<ColorValue>({
get: () => props.modelValue,
+1 -3
View File
@@ -99,9 +99,7 @@ const firstDayOfWeek = computed<number>(() => userStore.currentUserFirstDayOfWee
const dayNames = computed<string[]>(() => arrangeArrayWithNewStartIndex(getAllMinWeekdayNames(), firstDayOfWeek.value));
const isYearFirst = computed<boolean>(() => isLongDateMonthAfterYear());
const is24Hour = computed<boolean>(() => isLongTime24HourFormat());
const displayTime = computed<string>(() => {
return formatUnixTimeToLongDateTime(getActualUnixTimeForStore(getUnixTime(dateTime.value), getTimezoneOffsetMinutes(), getBrowserTimezoneOffsetMinutes()));
});
const displayTime = computed<string>(() => formatUnixTimeToLongDateTime(getActualUnixTimeForStore(getUnixTime(dateTime.value), getTimezoneOffsetMinutes(), getBrowserTimezoneOffsetMinutes())));
</script>
<style>
+1 -3
View File
@@ -70,9 +70,7 @@ const icons = {
const dropdownMenu = useTemplateRef<HTMLElement>('dropdownMenu');
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 icon = computed<string>({
get: () => props.modelValue,
+1 -3
View File
@@ -63,9 +63,7 @@ const emit = defineEmits<{
(e: 'step:change', stepName: string): void;
}>();
const isClickable = computed<boolean>(() => {
return props.clickable !== 'false' && props.clickable !== false;
});
const isClickable = computed<boolean>(() => props.clickable !== 'false' && props.clickable !== false);
function changeStep(step: StepBarItem): void {
if (isClickable.value) {