实现了以下场景
nextClassName={'text-hide'}
nextText={''}
nextIconComponent={
<RaisedButton
label='Next'
/>}
现在这为我提供了一个 Next 按钮,在按钮上方有一个包装 div,文本隐藏类应用于该 div 而不是按钮,因此下一个按钮的边框和背景保持原样。
让NEXT按钮外的背景和边框透明,我该怎么办
最佳答案
我在这个实现中采用的方法是完全错误的。 应该做的是使用该组件创建一个自定义分页组件,我们将创建一个 Next 和 Previous 按钮并下拉选择页码列表,然后将该自定义组件包含在 Griddle 部分
传递给 customPagerComponent 的值应该是一个 React 类,而不是简单的 jsx。以您的第一个示例为例,您可能希望这样做:
class MyCustomPagerComponent extends Component {
// boilerplate react stuff
render() {
// jsx for your component
}
}
然后在你的 Griddle jsx 中你会想要做的:
import MyCustomPagerComponent from 'path/to/component';
<Griddle
...
customPagerComponent={MyCustomPagerComponent}
>
下一个和上一个按钮都将出现在这个新的自定义分页组件中。
有关此 Griddle 问题的更多信息
https://github.com/GriddleGriddle/Griddle/issues/530
关于css - 如何更改 Griddle 中 Next/Prev 按钮的样式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41116334/