const footerWrapper = this.$refs.summaryTable.$el.querySelector('.el-table__footer-wrapper');
if (!footerWrapper) {
console.error('未找到合计行容器');
return;
}
const selector = `tbody tr td:nth-child(${i+1})`;
const targetCell = footerWrapper.querySelector(selector);
// const targetCell = footerWrapper.querySelector('tbody td:nth-child(2)');
if (!targetCell) {
console.error('未找到目标列');
return;
}
if (item.primaryKey && item.type==='link' ) {
// 绑定点击事件
targetCell.addEventListener('click', (e) => {
console.log('点击了',item.label);
let params = {
operateArrange:item.primaryKey
}
let allparams = {...this.jumpObj.query, ...params}
let allparstr = encodeURIComponent(JSON.stringify(allparams));
this.$router.push({
path: this.jumpObj.path,
query: {params: allparstr}
})
});
targetCell.style.pointerEvents = 'auto';
targetCell.style.color = '#FF6A6C'; // 直接修改颜色
targetCell.style.cursor = 'pointer';
}else {
// targetCell.removeEventListener('click', (e) => {})
targetCell.style.pointerEvents = 'none';
targetCell.style.color = ''; // 直接修改颜色
targetCell.style.cursor = '';
}
jquery给合计行的金额列添加点击事件
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。
推荐阅读更多精彩内容
- 1,添加点击事件,在myChart.setOption(option)下添加myChart.on('click',...
- 1.我用的是vue组件,在marker中添加events点击事件, 2.这个点击事件需要写在data里 如果要得到...