我想在Fluent UI中使用枢轴来显示菜单。
<Pivot linkSize={PivotLinkSize.large}>
<PivotItem headerText='userInfo' headerButtonProps={}>
<UserPage />
</PivotItem>
<PivotItem headerText='userConfig'>
<UserSetting />
</PivotItem>
<PivotItem headerText='Store'>
<StorePage />
</PivotItem>
<PivotItem headerText='SubInfo'>
<SubInfo />
</PivotItem>
</Pivot>
它显示如下:
但是我想将“数据透视表头”放到中间,我尝试更改样式属性,但是没有任何进展。
如何将数据透视表头对准中心?
如果要使所有按钮在水平方向上居中,只需将Pivot设置为flexbox并使其所有项目居中对齐即可:
<Pivot linkSize={PivotLinkSize.large}
styles={{ root: { display: 'flex', justifyContent: 'center' } }}>
<PivotItem headerText='userInfo' headerButtonProps={}>
<UserPage />
</PivotItem>
<PivotItem headerText='userConfig'>
<UserSetting />
</PivotItem>
<PivotItem headerText='Store'>
<StorePage />
</PivotItem>
<PivotItem headerText='SubInfo'>
<SubInfo />
</PivotItem>
</Pivot>
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句