我正在尝试验证列表是否具有特定的字段列表,它会不断返回列表中的所有现有字段,我该如何使这些工作正常进行?有没有更好的方法来实现我正在尝试的东西?
sp.web.lists.getByTitle("SliceBox").fields.select("Title","Body","Link","Picture","Visible").get()
.then( (fields: any[]) => {
console.log("> number of fields returned:", fields.length);
fields.forEach(f => {
console.log("> field:", f);
})
})
.catch( err => {
console.log("> fields failure: ", err);
});