如何禁用这个图标
import * as React from 'react';
import { IContextualMenuProps, IIconProps, Stack, IStackStyles } from '@fluentui/react';
import { CommandBarButton } from '@fluentui/react/lib/Button';
export interface IButtonExampleProps {
// These are set based on the toggles shown above the examples (not needed in real code)
disabled?: boolean;
checked?: boolean;
}
const menuProps: IContextualMenuProps = {
items: [
{
key: 'emailMessage',
text: 'Email message',
iconProps: { iconName: 'Mail' },
},
{
key: 'calendarEvent',
text: 'Calendar event',
iconProps: { iconName: 'Calendar' },
},
],
};
const addIcon: IIconProps = { iconName: 'Add' };
const mailIcon: IIconProps = { iconName: 'Mail' };
const stackStyles: Partial<IStackStyles> = { root: { height: 44 } };
export const ButtonCommandBarExample: React.FunctionComponent<IButtonExampleProps> = props => {
const { disabled, checked } = props;
// Here we use a Stack to simulate a command bar.
// The real CommandBar control also uses CommandBarButtons internally.
return (
<Stack horizontal styles={stackStyles}>
<CommandBarButton
iconProps={addIcon}
text="New item"
// Set split=true to render a SplitButton instead of a regular button with a menu
// split={true}
menuProps={menuProps}
disabled={disabled}
checked={checked}
/>
<CommandBarButton iconProps={mailIcon} text="Send mail" disabled={disabled} checked={checked} />
</Stack>
)
};
如何禁用此图标 在Fluent-UI按钮组件
中 我需要添加以禁用它。 谁能为此提供帮助 因为我无法 进入流利的UI反应 https://developer.microsoft.com/en-us/fluentuii e #/controls/web/button
import * as React from 'react';
import { IContextualMenuProps, IIconProps, Stack, IStackStyles } from '@fluentui/react';
import { CommandBarButton } from '@fluentui/react/lib/Button';
export interface IButtonExampleProps {
// These are set based on the toggles shown above the examples (not needed in real code)
disabled?: boolean;
checked?: boolean;
}
const menuProps: IContextualMenuProps = {
items: [
{
key: 'emailMessage',
text: 'Email message',
iconProps: { iconName: 'Mail' },
},
{
key: 'calendarEvent',
text: 'Calendar event',
iconProps: { iconName: 'Calendar' },
},
],
};
const addIcon: IIconProps = { iconName: 'Add' };
const mailIcon: IIconProps = { iconName: 'Mail' };
const stackStyles: Partial<IStackStyles> = { root: { height: 44 } };
export const ButtonCommandBarExample: React.FunctionComponent<IButtonExampleProps> = props => {
const { disabled, checked } = props;
// Here we use a Stack to simulate a command bar.
// The real CommandBar control also uses CommandBarButtons internally.
return (
<Stack horizontal styles={stackStyles}>
<CommandBarButton
iconProps={addIcon}
text="New item"
// Set split=true to render a SplitButton instead of a regular button with a menu
// split={true}
menuProps={menuProps}
disabled={disabled}
checked={checked}
/>
<CommandBarButton iconProps={mailIcon} text="Send mail" disabled={disabled} checked={checked} />
</Stack>
)
};
How to disable this icon
in fluent-ui button component
which props or method
i need to add to disable it.
can anyone help regarding it
as i am not able to
get into fluent ui react
https://developer.microsoft.com/en-us/fluentui#/controls/web/button
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以特定
菜单菜单
(读取在这里)如果指定为空字符串,则不会显示图标。添加此属性
MENUICONPROPS = {{{ICONNAME:“”}}}
带有上述更改,将显示按钮,如下所示:
You can specific the
menuIconProps
(read here) which will not display the icon if specified as empty string.Add this property
menuIconProps={{iconName: ""}}
With above change, the button will be displayed as shown below: