element-ui datatable 树形懒加载 节点展开异常的问题

const load=async(row:any, expanded:any, resolve: any)=>{

  console.log(row.id)

  if (expanded) {

    const result = await projectApi.page({pid:row.id,page:1,pageSize:999}).then(res => res.data.result);

    row.children = result?.items ?? [];

    row.hasChildren = false;

    resolve(row.children );//这个必须要有,不然第一次加载会展不开

  }

}

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注