-
-
Notifications
You must be signed in to change notification settings - Fork 328
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
121 additions
and
13 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<script lang="ts" setup> | ||
defineProps<{ | ||
icon: string | ||
label: string | ||
to: string | ||
}>() | ||
</script> | ||
|
||
<template> | ||
<NuxtLink | ||
:to="to" | ||
flex="~ col" | ||
border="~ solid dark:$ylf-c-border" | ||
bg="$ylf-c-bg-alt" | ||
class="inline-flex items-center justify-center rounded-md px-4 py-2 text-sm font-medium decoration-none hover-bg-gray-100 focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-blue-500 dark:hover:bg-dark-400" | ||
> | ||
<div :class="icon" inline-flex text-lg /> | ||
<div mt-2 inline-flex text-xs> | ||
{{ label }} | ||
</div> | ||
</NuxtLink> | ||
</template> |
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,10 @@ | ||
import { useStorage } from '@vueuse/core' | ||
import { namespace } from '~/constants' | ||
import type { RecipeItem } from '~/types' | ||
|
||
export interface RecipeHistoryItem { | ||
recipe: RecipeItem | ||
time: number | ||
} | ||
|
||
export const recipeHistories = useStorage<RecipeHistoryItem[]>(`${namespace}:history`, []) |
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,12 @@ | ||
<script lang="ts" setup> | ||
definePageMeta({ | ||
layout: 'child', | ||
title: '我的收藏', | ||
}) | ||
</script> | ||
|
||
<template> | ||
<div> | ||
施工中... | ||
</div> | ||
</template> |
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,38 @@ | ||
<script lang="ts" setup> | ||
import dayjs from 'dayjs' | ||
import { recipeHistories } from '~/composables/store/history' | ||
definePageMeta({ | ||
layout: 'child', | ||
title: '历史记录', | ||
}) | ||
// todo | ||
// clear one history | ||
function clearAllHistory() { | ||
recipeHistories.value = [] | ||
} | ||
</script> | ||
|
||
<template> | ||
<div pt-2> | ||
<div | ||
text="blue-900 dark:blue-200" | ||
bg="blue-300 op-20 hover:(blue-800 op-20) dark:hover:(blue-200 op-20)" | ||
class="inline-flex items-center justify-center border border-transparent rounded-md px-4 py-2 text-sm font-medium focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-blue-500" | ||
@click="clearAllHistory" | ||
> | ||
<div i-ri-eraser-line /> | ||
<span class="ml-1">清空记录</span> | ||
</div> | ||
|
||
<div flex="~ col"> | ||
<div v-for="history in recipeHistories" :key="history.recipe.name" mt-2> | ||
<StapleTag :active="false"> | ||
{{ dayjs(history.time).format('YYYY-MM-DD HH:mm:ss') }} | ||
</StapleTag> | ||
<DishTag :dish="history.recipe" /> | ||
</div> | ||
</div> | ||
</div> | ||
</template> |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.