vue判断点击元素是否有指定class
2021-04-07 本文已影响0人
缓慢的蜗牛
<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);
}