当前,我正在使用水平堆栈将“按钮组件”“添加”到命令栏。理想的解决方案应该是将CalendarButtonExample组件添加到CommandBar项目(ICommandBarItemProps)中,以便采用CommandBar等的样式。是否有办法将组件添加到ICommandBarItemProps []数组项目中?
当前
<Stack horizontal>
<CalendarButtonExample />
<CommandBar
items={_items}
overflowItems={_overflowItems}
overflowButtonProps={overflowProps}
farItems={_farItems}
ariaLabel="Use left and right arrow keys to navigate between commands"
/>
</Stack>
这是_items的样子
const _items: ICommandBarItemProps[] = [
{
key:"dateSelector",
text:"SelectDate",
iconProps:{iconName:"Calendar"}
},
{
key: "today",
text: "Today",
iconProps: { iconName: "Upload" },
href: "https://developer.microsoft.com/en-us/fluentui"
},
... ]