|
@@ -33,7 +33,7 @@ import {
|
|
|
ZoomOutOutlined,
|
|
|
FullscreenOutlined,
|
|
|
} from "@ant-design/icons-vue";
|
|
|
-import { computed } from "vue";
|
|
|
+import { computed, onMounted, onUnmounted } from "vue";
|
|
|
import { store } from "@/store/store";
|
|
|
|
|
|
const upScale = () => {
|
|
@@ -55,6 +55,20 @@ const greaterThanOneScale = computed(() => {
|
|
|
const lessThanOneScale = computed(() => {
|
|
|
return store.setting.uiSetting["answer.paper.scale"] < 1;
|
|
|
});
|
|
|
+
|
|
|
+function keyListener(event: KeyboardEvent) {
|
|
|
+ if (event.key === "+") {
|
|
|
+ upScale();
|
|
|
+ } else if (event.key === "-") {
|
|
|
+ downScale();
|
|
|
+ }
|
|
|
+}
|
|
|
+onMounted(() => {
|
|
|
+ document.addEventListener("keydown", keyListener);
|
|
|
+});
|
|
|
+onUnmounted(() => {
|
|
|
+ document.removeEventListener("keydown", keyListener);
|
|
|
+});
|
|
|
</script>
|
|
|
|
|
|
<style scoped>
|