Comments (5)
@changming1987117 详细说下情况吧
from el-search-table-pagination.
我现在后台返回的时候list和total是异步返回来的,因为total很大,为了体验问题,list和total是两个接口返回来的
我只会这样写fetch
fetch(params){
return new Promise(resolve => {
return resolve(API.getTaskList(params));
})
}
这样写的时候,貌似list和total一起返回才可以,
所以想请教下,异步的情况下是怎么写fetch,忘不吝赐教
from el-search-table-pagination.
你可以用promise把两个异步加载封装到一个promise里面,然后传给 fetch
属性。 https://github.com/zollero/el-search-table-pagination/blob/master/docs/zh_CN.md#%E5%B1%9E%E6%80%A7
from el-search-table-pagination.
示例如下:
function getData() {
return new Promise((resolve, reject) => {
Promise.all(
// 这里用两个promise来获取list和total,然后封装在一起
)
})
}
from el-search-table-pagination.
非常感谢大神的回复,这种写法也是要等两个promise都执行完才会渲染表格数据吧,我希望的是任意一个执行完就开始渲染,因为count计算非常耗时,所以希望可以先把一页的数据展示出来,而不是等待count执行完毕才开始渲染表格,请问这样可以做到吗?
from el-search-table-pagination.
Related Issues (20)
- header-row-class-name 不支持这个属性吗
- slot prepend append是el-table的插槽,不是el-search-table-pagination的插槽,要怎么使用呢?
- 自己添加了按钮为什么查询不可以?下面是源码请大神解答
- 希望能给form表单的重置按钮添加回调 HOT 1
- 看源码el-table和el-table-column属性和事件绑定太麻烦了,有简单方式 HOT 2
- resetBtnCallback回调执行重新查询时其他条件正常重置,但daterange不能重置 HOT 2
- render函数return的内容怎么让换行显示 HOT 1
- 可以实现模糊查询吗? HOT 4
- 关于使用后的一些建议 HOT 2
- 设置table为remote的模式时,form的search按钮会抖动 HOT 3
- Possibility argument issue for function searchHandler HOT 1
- 希望form中的select改变时能添加传递change事件 HOT 1
- 验证 HOT 1
- 报错:javascript miss dev ,如何解决 HOT 2
- 自定义列使用slotName属性时,出现重复
- 多级联动的选择框取值和传参 HOT 1
- Usage of column type "expand"
- 如果要在table中的某一列显示图片,使用render吗
- Set search form values HOT 2
- 筛选栏 目前是不支持远程模糊搜索吗 remoteMethod HOT 1
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 el-search-table-pagination.