vue判断点击元素是否有指定class

<div class="ku-menu-item-group active"  @click="clickFold"></div>
 clickFold: function (e) {
        e = e || window.event;
        let isActive = e.currentTarget.getAttribute("class").includes("active");
        console.log("isActive----------------",isActive);
 }
Logo

前往低代码交流专区

更多推荐