闫增涛
2024-06-25 a4ca94a580c518285395ce8da62d0165ab0de3a1
src/components/dragQuestion/index.vue
@@ -193,6 +193,7 @@
      maxX: null,
      maxY: null,
      spaceList: [],
      submitState:false,
    };
  },
  mounted() {
@@ -204,6 +205,7 @@
    // 3.限制鼠标松开要在空格的范围内
    mousedown(e) {
      e.preventDefault();
      if(this.submitState) return false
      console.log("鼠标按下", e);
      this.moveDom = e.toElement;
      this.parentDom = this.getParentWithClass(e.toElement, "question-box");
@@ -298,6 +300,7 @@
    },
    // 提交
    submitData() {
      this.submitState = true
      let arr = [];
      const data = this.drageQuestion;
      for (let index = 0; index < data.length; index++) {
@@ -309,10 +312,10 @@
        item.isRight = arr == item.answer
        item.isComplete = true
      }
      console.log(arr,this.drageQuestion[0]);
    },
    redio() {
      this.submitState = false
      localStorage.removeItem(
        this.config.activeBook.name + "-drag-" + this.page
      );