✨ (edit) exit edit mode on escape press
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
<script lang="ts" setup>
|
||||
import { useMagicKeys } from '@vueuse/core'
|
||||
import {
|
||||
computed,
|
||||
defineAsyncComponent,
|
||||
@@ -100,6 +101,14 @@ watch(mode, async (newMode) => {
|
||||
initialRawContent.value = rawContent.value
|
||||
}
|
||||
})
|
||||
|
||||
const { escape } = useMagicKeys()
|
||||
|
||||
watch(escape, () => {
|
||||
if (mode.value === 'edit') {
|
||||
toggleMode()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
||||
Reference in New Issue
Block a user