mirror of
https://gitee.com/spark-store-project/spark-store
synced 2026-04-26 01:10:16 +08:00
添加主页功能,支持加载和展示首页数据,包括链接和推荐应用列表
This commit is contained in:
@@ -10,7 +10,7 @@
|
||||
>
|
||||
<i class="fas fa-bars"></i>
|
||||
</button>
|
||||
<TopActions @update="$emit('update')" @list="$emit('list')" />
|
||||
<TopActions @update="$emit('update')" @list="$emit('list')" @open-install-settings="$emit('open-install-settings')" />
|
||||
</div>
|
||||
<div class="w-full flex-1">
|
||||
<label for="searchBox" class="sr-only">搜索应用</label>
|
||||
@@ -24,12 +24,13 @@
|
||||
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="搜索应用名 / 包名 / 标签,按回车键搜索"
|
||||
@keydown.enter="handleSearch"
|
||||
@focus="handleSearchFocus"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="text-sm text-slate-500 dark:text-slate-400" id="currentCount">
|
||||
共 {{ appsCount }} 个应用 · 在任何主流 Linux 发行上安装应用
|
||||
<div v-if="activeCategory !== 'home'" class="text-sm text-slate-500 dark:text-slate-400" id="currentCount">
|
||||
共 {{ appsCount }} 个应用
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -48,6 +49,8 @@ const emit = defineEmits<{
|
||||
(e: "update-search", query: string): void;
|
||||
(e: "update"): void;
|
||||
(e: "list"): void;
|
||||
(e: "search-focus"): void;
|
||||
(e: "open-install-settings"): void;
|
||||
(e: "toggle-sidebar"): void;
|
||||
}>();
|
||||
|
||||
@@ -57,6 +60,10 @@ const handleSearch = () => {
|
||||
emit("update-search", localSearchQuery.value);
|
||||
};
|
||||
|
||||
const handleSearchFocus = () => {
|
||||
emit("search-focus");
|
||||
};
|
||||
|
||||
watch(
|
||||
() => props.searchQuery,
|
||||
(newVal) => {
|
||||
|
||||
Reference in New Issue
Block a user