Bootstrap-table默认的传参
Bootstrap-table每次刷新或者排序都会自动向设置好的url发送一个请求,请求中包含4个默认的参数
- 当data-query-params-type属性设置成limit时(默认情况)
四个参数为:limit
,offset
,sort
,order
- 当data-query-params-type为空时
四个参数为:pageSize
,pageNumber
,sortName
,sortOrder
参考:
https://bootstrap-table.com/docs/api/table-options/#queryparams
增加自定义参数
然而仅凭这几个参数只能实现排序,无法实现条件查询,要想table发送请求时增加自定义参数,这时候就需要设置
data-query-params属性。
当设置table的data-query-params后
data-query-params="queryParams"
就可以通过一个js函数来在Bootstrap-table发送请求前增加参数
function queryParams(