feat: 添加返回启动页面功能,支持用户快速返回

This commit is contained in:
Vixalie
2026-03-27 17:27:29 +08:00
parent 2bef39287d
commit 93f66c51bf
+13
View File
@@ -1,5 +1,6 @@
<script lang="ts"> <script lang="ts">
import { afterNavigate, goto } from '$app/navigation'; import { afterNavigate, goto } from '$app/navigation';
import Close from '$lib/components/icons/Close.svelte';
import { openedDatasetDir } from '$lib/stores/dataset'; import { openedDatasetDir } from '$lib/stores/dataset';
import { currentActivate } from '$lib/stores/navigate'; import { currentActivate } from '$lib/stores/navigate';
import type { DatasetMeta } from '$lib/types/meta'; import type { DatasetMeta } from '$lib/types/meta';
@@ -15,6 +16,10 @@ afterNavigate(() => {
let storePath = $state(''); let storePath = $state('');
let datasetName = $state(''); let datasetName = $state('');
async function backToBoot() {
await goto('/boot');
}
async function selectStorePath() { async function selectStorePath() {
try { try {
const selectResult = await open({ const selectResult = await open({
@@ -85,6 +90,14 @@ async function createDataset() {
} }
</script> </script>
<button
class="btn btn-circle btn-error btn-sm fixed top-12 right-6 z-10"
title="Back to boot"
aria-label="Back to boot"
onclick={backToBoot}>
<Close width="24" />
</button>
<main class="flex flex-col gap-2 p-4 self-center"> <main class="flex flex-col gap-2 p-4 self-center">
<h2>Create new dataset</h2> <h2>Create new dataset</h2>
<div class="join"> <div class="join">