0

有谁知道在 SPFx 中查找列表或文档库中列类型的最佳方法?我的意思是如果它是“单行文本”“日期和时间”“选择”“超链接或图片”等谢谢 P

4

1 回答 1

2

使用 PnPjs 很容易做到这一点:https ://pnp.github.io/pnpjs/sp/fields/

前任:

  const fieldInfo = await sp.web.lists.getByTitle("List1").fields.getByInternalNameOrTitle("FieldName")();
  console.log(fieldInfo .TypeDisplayName)
于 2021-10-20T09:20:14.170 回答