【问题标题】:what is different between style vs styles in component - fluentui/react-northstar组件中的样式与样式有什么不同 - fluentui/react-northstar
【发布时间】:2022-06-24 02:04:56
【问题描述】:

我正在使用fluentui/react-northstar
在文档中,styles 具有以下定义

Name    Default Type         Description  

styles  ComponentSlotStyle   Additional CSS styles to apply to the component instance.  

但是组件中的 stylestyles 有什么不同。

<Flex styles={{ marginTop: 15 }}> </Flex> 

<Flex style={{ marginTop: 15 }}> </Flex>

【问题讨论】:

    标签: fluent-ui fluentui-react


    【解决方案1】:

    stylereact 为所有 HTML 元素提供的一个 prop(与 HTML 中的 style 属性相同)

    styles 是为接受IStyleableComponentProps 的组件提供的道具,它提供了对样式属性的附加功能,例如主题。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2022-12-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-04-20
      • 2022-08-09
      • 2017-11-17
      相关资源
      最近更新 更多