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