Browse Source

修改bug

bill 10 months ago
parent
commit
565a2dbf39
3 changed files with 6 additions and 2 deletions
  1. 1 2
      src/view/case/draw/eshape.vue
  2. 2 0
      src/view/case/draw/header.vue
  3. 3 0
      src/view/case/draw/state.ts

+ 1 - 2
src/view/case/draw/eshape.vue

@@ -21,6 +21,7 @@
 import { computed, onMounted, onUnmounted, ref } from "vue";
 import { BoardShape, compass, title } from "./board";
 import { components } from "./edit-shape";
+import { inputIng } from "./state";
 
 const props = defineProps<{ shape: BoardShape }>();
 const emit = defineEmits<{
@@ -28,12 +29,10 @@ const emit = defineEmits<{
 }>();
 const editComponent = computed(() => {
   const type = props.shape.data.type;
-  console.log(type);
   if (type && components[type]) {
     return components[type];
   }
 });
-const inputIng = ref(false);
 
 const delHandler = () => {
   props.shape.delete();

+ 2 - 0
src/view/case/draw/header.vue

@@ -45,6 +45,7 @@
 import { BoardType } from "@/store/caseFile";
 import { BoardTypeDesc } from "@/constant/caseFile";
 import { onMounted, onUnmounted } from "vue";
+import { inputIng } from "./state";
 
 const props = defineProps<{
   type: BoardType;
@@ -62,6 +63,7 @@ const emit = defineEmits<{
 }>();
 
 const keydownHandler = (ev: KeyboardEvent) => {
+  if (inputIng.value) return;
   if (ev.keyCode === 32) {
     emit("viewInit");
   } else if (["Control", "Ctrl"].includes(ev.key)) {

+ 3 - 0
src/view/case/draw/state.ts

@@ -0,0 +1,3 @@
+import { ref } from "vue";
+
+export const inputIng = ref(false);