【问题标题】:MUI TablePagination, what are "ActionComponent" vs "Component" props?MUI TablePagination,什么是“ActionComponent”与“Component”道具?
【发布时间】:2021-12-30 11:54:31
【问题描述】:

根据 MUI 文档 --> https://mui.com/api/table-pagination/#main-content,

ActionComponent = The component used for displaying the actions. Either a string to use a HTML element or a component.,

Component = The component used for the root node. Either a string to use a HTML element or a component,

看了上面的描述,我还是不明白它们到底是什么意思。

“ActionComponent”中的“显示动作”是什么意思?

“组件”中的“用于根节点的组件”是什么意思?

我可以举一些可靠的例子来演示如何使用“ActionComponent”和“Component”道具吗?

或者请参考相关资源。

【问题讨论】:

    标签: reactjs material-ui


    【解决方案1】:

    component 是根,整个TablePagination 组件的容器。使用示例:https://mui.com/components/tables/#sorting-amp-selecting - 你看到分页组件被定义为div。它会覆盖默认的td,以便在Table 之外正确呈现。

    ActionComponent 允许您覆盖根 TablePagination 组件内导航按钮的内部组件。很好的例子:https://mui.com/components/tables/#custom-pagination-actions

    【讨论】:

      猜你喜欢
      • 2023-02-24
      • 2022-08-05
      • 2022-12-03
      • 2022-10-15
      • 2021-12-29
      • 1970-01-01
      • 1970-01-01
      • 2021-07-09
      • 2021-12-01
      相关资源
      最近更新 更多