我在 Office Fabric UI 中使用 Pivot 组件,我需要为某些视图删除 PivotItem。有没有可能的方法?
等我需要在下面使用 isComposeMode() 删除“插入”枢轴
import * as React from "react";
import { Label } from "office-ui-fabric-react/lib/Label";
import { Pivot, PivotItem } from "office-ui-fabric-react/lib/Pivot";
import InsertView from "./InsertView";
export interface PivotProps {}
export interface PivotState {}
class MainNav extends React.Component<PivotProps, PivotState> {
render() {
return (
<div>
<Pivot>
<PivotItem headerText="Insert">
<InsertView />
</PivotItem>
<PivotItem headerText="Review">
<Label>Review</Label>
</PivotItem>
<PivotItem headerText="Settings">
<Label>Settings</Label>
</PivotItem>
</Pivot>
</div>
);
}
isComposeMode = (): boolean => {
if (Office.context.mailbox.item.displayReplyForm != undefined) {
return false;
} else {
return true;
}
};
}
export default MainNav;