cursor: not-allowed 与 pointer-events: none 冲突

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(); } 

posted @ 2021-07-07 09:12  张小中  阅读(1981)  评论(0编辑  收藏  举报