我使用的是 React 16.12.0 和
import { SimpleProvider, Providers, ProviderState } from '@microsoft/mgt';
import { PeoplePicker, People } from '@microsoft/mgt-react';
版本“^2.0.1”。
我没有找到的是:
在使用 defaultSelectedUserIds 并传递要加载的默认 ID 时如何使用 promise。页面加载时 PeoplePicker 输入为空,几秒钟后加载数据。 PeoplePicker 是否支持 promise?
当将默认 Ids 传递给 defaultSelectedUserIds 时,对象“e.target.selectedPeople”中的数据被加载如下:
@odata.context: "https://graph.microsoft.com/v1.0/$metadata#users/$entity"
businessPhones: []
displayName: "<user_name>"
givenName: "<name>"
id: "<user_id>"
jobTitle: null
mail: "<user_mail>"
mobilePhone: null
officeLocation: null
preferredLanguage: null
surname: "Marinov"
userPrincipalName: "<user_mail>"
__proto__: Object```
如果我们添加一个新用户,则不同,其中对象包含更多数据:
```2:
birthday: null
companyName: "<comapany_name>"
department: "<comapany_department>"
displayName: "<user_name>"
givenName: "<name>"
id: "<user_id>"
imAddress: "sip:<user_email>"
isFavorite: false
isFocused: false
jobTitle: "<user_job_title>"
officeLocation: "<office_location>"
personNotes: null
personType: {class: "Person", subclass: "OrganizationUser"}
phones: [{…}]
profession: null
scoredEmailAddresses: [{…}]
surname: "<name>"
userPrincipalName: "<email>"
yomiCompany: null
__proto__: Object
length: 3
__proto__: Array(0)```
这是正常行为还是我可以在使用“defaultSelectedUserIds”时加载相同的数据集?
谢谢