1. watch监听当前对话框的显示与否(这里的选择框的显示与否根据此字段,若一直存在则可在mounted)
isCondition: { // 添加icon箭头 handler(val) { if(val) { const doms = document.querySelectorAll('.usual-file-input i') doms.forEach(dom => { dom.classList.remove('el-icon-arrow-up') dom.classList.add('el-icon-arrow-up') }) console.log(doms); } } }
2. 添加点击后的旋转,可在抛出的方法中做处理
@visible-change="visibleChange($event, 'duty')" 该方法会返回的参数为布尔值,动态添加is-reverse 模拟点击与否的旋转if(e) { const doms = document.querySelectorAll('.usual-file-input i') doms.forEach(dom => { dom.classList.remove('is-reverse') dom.classList.add('is-reverse') }) key === 'duty' ? this.getDutyData() : this.getEquipData() } else { const doms = document.querySelectorAll('.usual-file-input i') doms.forEach(dom => { dom.classList.remove('is-reverse') }) }
标签:el,reverse,dom,classList,下拉箭头,doms,select,icon From: https://www.cnblogs.com/YuyuFishSmile/p/17144266.html