//接口拿到数据后绑定点击事件
nextTick(() => {
//选中表格一行的节点
const tableElements = document.querySelectorAll('.yxt-table__row');
if (tableElements) {
//遍历节点绑定点击事件
tableElements.forEach((element, index) => {
element.addEventListener('click', function () {
//选中箭头图标,绑定对应index箭头图标的点击事件
const el = document.querySelectorAll('.yxt-table__expand-icon');
el[index].addEventListener('click', function () {
});
// 创建一个点击事件
const clickEvent = new MouseEvent('click', {
bubbles: true,
cancelable: true,
view: window
});
// 触发点击事件
el[index].dispatchEvent(clickEvent);
});
});
}
})
//点击表格一行的每个位置触发展开效果element table 表格点击一行的任意位置触发展开下拉
最新推荐文章于 2025-01-08 11:52:36 发布
516

被折叠的 条评论
为什么被折叠?



