The list fields webpart should be used when targeting a list and fields as a datasource.
import { WebParts } from "gd-sprest-bs";// Create the webpartWebParts.WebPart({ elementId: "my-wpList", cfgElementId: "my-wpList-cfg", onRenderItems: (wpInfo, items) => { // Render the display element wpInfo.el.innerHTML = [ '<h1>List: ' + wpInfo.ListName + '</h1>', '<h5>List Items: ' + items.length + '</h5>' ].join('\n'); }}); Copy
import { WebParts } from "gd-sprest-bs";// Create the webpartWebParts.WebPart({ elementId: "my-wpList", cfgElementId: "my-wpList-cfg", onRenderItems: (wpInfo, items) => { // Render the display element wpInfo.el.innerHTML = [ '<h1>List: ' + wpInfo.ListName + '</h1>', '<h5>List Items: ' + items.length + '</h5>' ].join('\n'); }});
Generated using TypeDoc
List Fields WebPart
The list fields webpart should be used when targeting a list and fields as a datasource.