-
Notifications
You must be signed in to change notification settings - Fork 688
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
1 parent
4f70eb1
commit 5385777
Showing
4 changed files
with
54 additions
and
31 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,16 @@ | ||
<template> | ||
<button | ||
class="btn btn-outline btn-sm" | ||
@click="handleMastered" | ||
@click="markStatementAsMastered" | ||
> | ||
掌握 | ||
</button> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import { toast } from "vue-sonner"; | ||
import { useMastered } from "~/composables/main/useMastered"; | ||
import { isAuthenticated } from "~/services/auth"; | ||
const { handleMastered } = useMasteredShortcut(); | ||
function useMasteredShortcut() { | ||
const { markStatementAsMastered } = useMastered(); | ||
function handleMastered() { | ||
if (!isAuthenticated()) { | ||
toast.warning("需要登录哦"); | ||
return; | ||
} | ||
markStatementAsMastered(); | ||
} | ||
return { | ||
handleMastered, | ||
}; | ||
} | ||
const { markStatementAsMastered } = useMastered(); | ||
</script> | ||
|
||
<style scoped></style> |
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