Comments (5)
实际上Table中的filter sort均是需要向后台请求的,目前的Table只能一次性取出全部数据然后再处理
from react-ui.
不用内置的分页,用Pagination组件。
from react-ui.
不知如何用,因为Table组件是compose(
Fetch(true),
Filter,
Sort,
Pagination
)(Table)的,都内置了
from react-ui.
在使用Table组件时,不设置pagination,然后在Table下加<Pagination .../>吗? 这样没有组合的来得方便了
from react-ui.
嗯,是这样的,因为每个业务涉及到分页的情况都不一样,所以不好做成通用的组件。复用的话,自己外面在封装一层就可以了。大概类似这样。
class CustomTable extends Component {
constructor(props) {
// ...
this.state = { page = 1, size = 20 }
}
componentDidMount() {
this.fetch()
}
fetch() {
// fetch data
const { page, size } = this.state
fetch(this.props.baseUrl, {page,size}).then(...)
}
handlePageChange() {
this.setState({...}, this.fetch)
}
render() {
<Table />
<Pagination />
}
}
from react-ui.
Related Issues (20)
- 启动报错:You may need an appropriate loader to handle this file type. HOT 4
- react & typescript & webpack & ES6 HOT 1
- 请问下用antd表格columns的fixed 用‘left’和’right‘ 错怎么解决? HOT 1
- 关于css modules的问题 HOT 6
- 我在用web-dev-server时遇到下列问题 HOT 25
- 关于bootstrap4 HOT 6
- 1. Chrome65下行首没有办法输入正确的中文 HOT 1
- The module needs to be precompiled to ES5 before use
- table中pagination中的onChange问题 HOT 13
- Checkbox 使用后为何不能点击? HOT 16
- DatepickerRange数据验证逻辑错误 HOT 1
- 您好,请问如何开发类似的一套ui库,让其他人可供使用的。 HOT 1
- Table控件选中记录操作
- Datepicker的min值判断的问题 HOT 2
- 不支持typescript 没有@types吗? HOT 4
- webpack include 和 exclude的配置问题 HOT 2
- 地址打不开。 HOT 3
- Message模块下似乎有BUG HOT 1
- Trying to get in touch regarding a security issue
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-ui.