vue-vben-admin icon indicating copy to clipboard operation
vue-vben-admin copied to clipboard

insertTableDataRecord 函数没有自动生成 key

Open twenj opened this issue 1 year ago • 1 comments

今天在使用 insertTableDataRecord 函数时,发现插入的对象并没有自动生成 key,应该是个遗漏

twenj avatar Dec 28 '23 08:12 twenj

function insertTableDataRecord(
    record: Recordable | Recordable[],
    index?: number,
  ): Recordable[] | undefined {
    // if (!dataSourceRef.value || dataSourceRef.value.length == 0) return;
    index = index ?? dataSourceRef.value?.length;
    const _record = isObject(record) ? [record as Recordable] : (record as Recordable[]);
    unref(dataSourceRef).splice(index, 0, ..._record);
    return unref(dataSourceRef);
  }

是不是需要自行生成放在record里?

xachary avatar Jan 04 '24 07:01 xachary

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days

anncwb avatar Apr 09 '24 01:04 anncwb