refactor: improve code formatting and consistency across components

- Updated button and span elements in ThemeToggle.vue and TopActions.vue for better readability.
- Enhanced UninstallConfirmModal.vue and UpdateAppsModal.vue with consistent indentation and spacing.
- Refactored downloadStatus.ts and storeConfig.ts for improved code clarity.
- Standardized string quotes and spacing in typedefinition.ts and processInstall.ts.
- Ensured consistent use of arrow functions and improved variable declarations throughout the codebase.
This commit is contained in:
Elysia
2026-02-12 18:32:41 +08:00
parent e11740ad4c
commit 6622e70033
29 changed files with 1681 additions and 1042 deletions

View File

@@ -5,10 +5,16 @@
<div class="w-full flex-1">
<label for="searchBox" class="sr-only">搜索应用</label>
<div class="relative">
<i class="fas fa-search pointer-events-none absolute left-4 top-1/2 -translate-y-1/2 text-slate-400"></i>
<input id="searchBox" v-model="localSearchQuery"
<i
class="fas fa-search pointer-events-none absolute left-4 top-1/2 -translate-y-1/2 text-slate-400"
></i>
<input
id="searchBox"
v-model="localSearchQuery"
class="w-full rounded-2xl border border-slate-200/70 bg-white/80 py-3 pl-12 pr-4 text-sm text-slate-700 shadow-sm outline-none transition placeholder:text-slate-400 focus:border-brand/50 focus:ring-4 focus:ring-brand/10 dark:border-slate-800/70 dark:bg-slate-900/60 dark:text-slate-200"
placeholder="搜索应用名 / 包名 / 标签" @input="debounceSearch" />
placeholder="搜索应用名 / 包名 / 标签"
@input="debounceSearch"
/>
</div>
</div>
</div>
@@ -19,8 +25,8 @@
</template>
<script setup lang="ts">
import { ref, watch } from 'vue';
import TopActions from './TopActions.vue';
import { ref, watch } from "vue";
import TopActions from "./TopActions.vue";
const props = defineProps<{
searchQuery: string;
@@ -28,22 +34,25 @@ const props = defineProps<{
}>();
const emit = defineEmits<{
(e: 'update-search', query: string): void;
(e: 'update'): void;
(e: 'list'): void;
(e: "update-search", query: string): void;
(e: "update"): void;
(e: "list"): void;
}>();
const localSearchQuery = ref(props.searchQuery || '');
const localSearchQuery = ref(props.searchQuery || "");
const timeoutId = ref<ReturnType<typeof setTimeout> | null>(null);
const debounceSearch = () => {
if (timeoutId.value) clearTimeout(timeoutId.value);
timeoutId.value = setTimeout(() => {
emit('update-search', localSearchQuery.value);
emit("update-search", localSearchQuery.value);
}, 220);
};
watch(() => props.searchQuery, (newVal) => {
localSearchQuery.value = newVal || '';
});
watch(
() => props.searchQuery,
(newVal) => {
localSearchQuery.value = newVal || "";
},
);
</script>