refs #3300 Handle shortcut keys in Preferences
This commit is contained in:
parent
225ab4a56f
commit
38d7a4bab8
|
@ -57,6 +57,7 @@
|
|||
<script lang="ts">
|
||||
import { defineComponent, computed } from 'vue'
|
||||
import { useRouter, useRoute } from 'vue-router'
|
||||
import { useMagicKeys, whenever } from '@vueuse/core'
|
||||
import { useStore } from '@/store'
|
||||
|
||||
export default defineComponent({
|
||||
|
@ -65,10 +66,15 @@ export default defineComponent({
|
|||
const store = useStore()
|
||||
const router = useRouter()
|
||||
const route = useRoute()
|
||||
const { escape } = useMagicKeys()
|
||||
|
||||
const primaryColor = computed(() => store.state.App.theme.primary_color)
|
||||
const backgroundColor = computed(() => store.state.App.theme.background_color)
|
||||
|
||||
whenever(escape, () => {
|
||||
close()
|
||||
})
|
||||
|
||||
const close = () => {
|
||||
router.push({ path: '/', query: { redirect: 'home' } })
|
||||
}
|
||||
|
|
|
@ -134,8 +134,7 @@ export default defineComponent({
|
|||
notifyPollVote,
|
||||
notifyPollExpired
|
||||
}
|
||||
},
|
||||
created() {}
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
|
|
Loading…
Reference in New Issue