编码规范真是个大问题!看看大聪明写的代码!

92 阅读1分钟

先声明,我们公司不按代码行数算工资

<span
          class="pointer"
          style="float: right"
          @click="open('similar')"
          v-if="similarShow"
          >-</span
        >
        <span
          class="pointer"
          style="float: right"
          @click="close('similar')"
          v-else
          >+</span
        >
        
        
    open(id) {
      if ((id = "manualRecordTime")) {
        this.manualRecordTimeShow = false;
      }
      if ((id = "manualRecord")) {
        this.manualRecordShow = false;
      }
      if (id == "checkStatus") {
        this.checkStatusShow = false;
      }
      if (id == "checkWay") {
        this.checkWayShow = false;
      }
      if (id == "time") {
        this.timeShow = false;
      }
      if (id == "language") {
        this.languageShow = false;
      }
      if (id == "opinionField") {
        this.opinionFieldShow = false;
      }
      if (id == "dataType") {
        this.typeOfdataShow = false;
      }
      if (id == "hot") {
        this.hotShow = false;
      }
      if (id == "similar") {
        this.similarShow = false;
      }
      if (id == "forward") {
        this.forwardShow = false;
      }
    },
    close(id) {
      if ((id = "manualRecordTime")) {
        this.manualRecordTimeShow = true;
      }
      if ((id = "manualRecord")) {
        this.manualRecordShow = true;
      }
      if (id == "checkStatus") {
        this.checkStatusShow = true;
      }
      if (id == "checkWay") {
        this.checkWayShow = true;
      }
      if (id == "time") {
        this.timeShow = true;
      }
      if (id == "language") {
        this.languageShow = true;
      }
      if (id == "opinionField") {
        this.opinionFieldShow = true;
      }
      if (id == "dataType") {
        this.typeOfdataShow = true;
      }
      if (id == "hot") {
        this.hotShow = true;
      }
      if (id == "similar") {
        this.similarShow = true;
      }
      if (id == "forward") {
        this.forwardShow = true;
      }
    },