Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

封装好的表格s-table中如何使用关键字查询条件 #306

Closed
loveFemi opened this issue Jun 28, 2019 · 3 comments
Closed

封装好的表格s-table中如何使用关键字查询条件 #306

loveFemi opened this issue Jun 28, 2019 · 3 comments
Labels
question Further information is requested

Comments

@loveFemi
Copy link

表格外面有很多查询条件,设置点击后更改参数queryParam,调用查询服务,

parameter => {
return this.$http.get('/service', {
params: Object.assign(parameter, this.queryParam)
}).then(res => {
return res.result
})
}
这里会报错。
正确使用姿势如何?

@loveFemi loveFemi added the question Further information is requested label Jun 28, 2019
@sendya
Copy link
Member

sendya commented Jun 28, 2019

报什么错?请说明

另外,可以阅读 #90 (Issue / PR 编写建议 (必读) )

@loveFemi
Copy link
Author

报什么错?请说明

另外,可以阅读 #90 (Issue / PR 编写建议 (必读) )

表格初始数据:
// 表格数据
tabledata: parameter => {
return getServiceList(Object.assign(parameter, this.queryParam))
.then(res => {
return res.result
})
},
表格外添加查询字段后调用的方法:
getTableList: parameter => {
return getServiceList(Object.assign(parameter, this.queryParam))
.then(res => {
this.tabledata = res.result
})
}
其中getServiceList是封装好的axios请求
报错信息如下截图:
image

@sendya
Copy link
Member

sendya commented Jun 28, 2019

错误看不懂吗? queryParam 找不到,你把这个参数怎么了?如果你要自己换变量,请把变量修改到请求方法里的 Object.assgin()

https://github.com/sendya/ant-design-pro-vue/blob/master/src/views/list/TableList.vue#L152

@sendya sendya closed this as completed Jul 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants