gpt4 book ai didi

reactjs - 如何在 react-pagination 包中添加带有下一个和上一个按钮的 html i 标签

转载 作者:行者123 更新时间:2023-12-02 02:15:46 31 4
gpt4 key购买 nike

这是我的代码:

                         <ReactPaginate
previousLabel={'Previous'}
nextLabel={'Next'}
breakLabel={"..."}
breakClassName={"break-me"}
pageCount={this.state.pageCount}
marginPagesDisplayed={2}
pageRangeDisplayed={5}
onPageChange={this.handlePageClick}
containerClassName={"pagination"}
pageClassName={'page-item'}
subContainerClassName={"page-item"}
activeClassName={"active"}
pageLinkClassName={'page-link'}
/>

我想用 previousLabelnextlabel 添加 html i 标签

最佳答案

nextLabel 接受一个节点

enter image description here

所以你可以在大括号内使用 jsx。

nextLabel={<i your icon node here />} 

或使用图像(示例)

nextLabel={<img src={image url} />}

或带文字的图标

previousLabel={<div><i class="fa fa-arrow-left" aria-hidden="true" />Previous</div>}

关于reactjs - 如何在 react-pagination 包中添加带有下一个和上一个按钮的 html i 标签,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67207721/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com