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