css 中不能同时使用这两个属性,禁止点击可以用js代替

<div
            class="proBox"
            :class="[
              { checked: checkProduct == item.buildingId },
              { hui: !item.unitCount },
            ]"
            v-for="item in panelList.buildingDTOS"
            :key="item.buildingId"
            @click="
              (e) => {
                if (item.unitCount) {
                  filterProduct(item.buildingId);
                } else {
                  e.preventDefault();
                }
              }
            "
          >

把对应的事件 handler 改为 (e) => { e.preventDefault(); } 

相关文章:

  • 2021-08-20
  • 2021-10-04
  • 2022-01-12
  • 2022-01-15
  • 2021-07-11
  • 2021-09-26
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案