//接口拿到数据后绑定点击事件
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);
});
});
}
})