Skip to content

Commit

Permalink
增加ctrl+enter提交快捷键
Browse files Browse the repository at this point in the history
  • Loading branch information
kingwrcy committed Apr 21, 2024
1 parent d809ac9 commit 85853cf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 18 deletions.
2 changes: 1 addition & 1 deletion components/FriendsCommentInput.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<div class="p-2 rounded text-sm ">
<div class="relative">
<Textarea ref="textareaRef" autocomplete="new-text" rows="3" v-model="content" class="dark:bg-slate-500 border-separate" :placeholder="placeholder" </Textarea>
<Textarea @keyup.ctrl.enter="saveComment" ref="textareaRef" autocomplete="new-text" rows="3" v-model="content" class="dark:bg-slate-500 border-separate" :placeholder="placeholder" </Textarea>
<div class="absolute right-2 bottom-1 cursor-pointer text-xl" @click="toggleShowEmoji" ref="showEmojiRef">😊</div>
</div>
<Emoji v-if="showEmoji" class="mt-2" @emoji-selected="emojiSelected"/>
Expand Down
21 changes: 4 additions & 17 deletions components/MemoInput.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
<template>
<div class="p-2 sm:p-4 pb-2 border-b dark:border-white">
<div class="flex flex-row my-2 ">
<div class="flex flex-1 gap-2 ">

<div class="flex flex-1 gap-2 ">
<Popover :open="linkOpen">
<PopoverTrigger as="div">
<TooltipProvider>
Expand All @@ -15,7 +14,6 @@
</TooltipContent>
</Tooltip>
</TooltipProvider>

</PopoverTrigger>
<PopoverContent as-child @interact-outside="linkOpen = false">
<div class="flex flex-col gap-2">
Expand Down Expand Up @@ -134,7 +132,7 @@

</div>
<div class="relative">
<Textarea ref="textareaRef" @paste="pasteImg" autocomplete="new-text" v-model="content" rows="4"
<Textarea ref="textareaRef" @paste="pasteImg" autocomplete="new-text" v-model="content" rows="4" @keyup.ctrl.enter="submitMemo()"
placeholder="今天发点什么呢?" class=" dark:text-[#C0BEBF]"></Textarea>
<div class="absolute right-2 bottom-1 cursor-pointer text-xl" @click="toggleShowEmoji" ref="showEmojiRef">😊</div>
</div>
Expand Down Expand Up @@ -193,19 +191,8 @@ import { toast } from 'vue-sonner'
import { memoUpdateEvent } from '@/lib/event'
import type { Memo } from '~/lib/types';
import { useAnimate } from '@vueuse/core';
import { Image, Music4, Settings, Trash2, LogOut, Youtube, Link, Loader, CircleX, Check, ShowerHead } from 'lucide-vue-next'
import {
Tooltip,
TooltipContent,
TooltipProvider,
TooltipTrigger
} from '@/components/ui/tooltip'
import {
Popover,
PopoverContent,
PopoverTrigger,
} from '@/components/ui/popover'
import { Image, Music4, Settings, Trash2, LogOut, Link, Youtube, CircleX, Check } from 'lucide-vue-next'
const textareaRef = ref()
const showEmojiRef = ref<HTMLElement>()
const keyframes = { transform: 'rotate(360deg)' }
Expand Down

0 comments on commit 85853cf

Please sign in to comment.