我最近偶然发现了一个应该很简单的共享点问题,我只是无法让它工作:(。
在这里的代码中,我有一个简单的搜索框,没什么特别的
import * as React from 'react';
import { SearchBox } from 'office-ui-fabric-react/lib/SearchBox';
export class Searchbox extends React.Component<any, any> {
public render() {
return (
<SearchBox/>
);
}
}
在搜索框下,我想根据https://sharepoint.github.io/sp-dev-fx-property-controls/controls/PropertyFieldPeoplePicker/添加一个人员选择器(与搜索框无关)
这实质上意味着:添加这几行圆锥
import { PropertyFieldPeoplePicker, PrincipalType } from '@pnp/spfx-property-controls/lib/PropertyFieldPeoplePicker';
import { IPropertyFieldGroupOrPerson } from "@pnp/spfx-property-controls/lib/PropertyFieldPeoplePicker";
export interface IPropertyControlsTestWebPartProps {
people: IPropertyFieldGroupOrPerson[];
}
根据上面的链接,我必须使用它来使用人员选择器。
PropertyFieldPeoplePicker('people', {
label: 'PropertyFieldPeoplePicker',
initialData: this.properties.people,
allowDuplicate: false,
principalType: [PrincipalType.Users, PrincipalType.SharePoint,
PrincipalType.Security],
onPropertyChange: this.onPropertyPaneFieldChanged,
context: this.context,
properties: this.properties,
onGetErrorMessage: null,
deferredValidationTime: 0,
key: 'peopleFieldId'
})
但无论我做什么,我都无法在我的搜索框下方添加人员选择器
谁能告诉我它是怎么做的?非常感谢您提前!
我已经完成了入门部分,但我无法让人员选择器选项卡显示,我什至无法编译:/