-
Notifications
You must be signed in to change notification settings - Fork 487
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #571 from sugarforever/feat/default-page
feat: support custom the default page
- Loading branch information
Showing
6 changed files
with
53 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
|
||
export default defineNuxtRouteMiddleware((to, from) => { | ||
const defaultPage = useCookie('default-page', { path: '/', default: () => DEFAULT_PAGE_LINK }) | ||
|
||
if (to.path === '/') { | ||
return navigateTo(defaultPage.value) | ||
} | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<script setup> | ||
const { t } = useI18n() | ||
</script> | ||
<template> | ||
<div class="text-lg mx-auto max-w-6xl"> | ||
<h1 class="font-bold text-2xl my-8">{{ t("home.welcome") }}</h1> | ||
<p v-html="t('home.description')"></p> | ||
|
||
<h2 class="font-bold text-xl my-4">{{ t('home.quickStart') }}</h2> | ||
|
||
<ul class="list-decimal list-inside"> | ||
<li v-html="t('home.step1')"></li> | ||
<li v-html="t('home.step2')"></li> | ||
<li> | ||
{{ t('home.step3') }} | ||
<ul class="list-disc list-inside ml-4"> | ||
<li v-html="t('home.step3_1')"></li> | ||
<li v-html="t('home.step3_2')"></li> | ||
</ul> | ||
</li> | ||
</ul> | ||
</div> | ||
</template> |