We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
dispatch(routerRedux.push({ pathname: location.pathname, query: { ...value, searchTags:tags, page: 1, pageSize, }, })) 这里searchTags是一个数组,但是上面的写法不能正确获取结果,url上的参数显示是searchTags=XXX,如果把url参数改成searchTags[]=XXX就可以获得正确结果,那么怎么在query里面定义数组参数呢?我试着改成searchTags[]:tags,但是程序报错了
dispatch(routerRedux.push({ pathname: location.pathname, query: { ...value, searchTags:tags, page: 1, pageSize, }, }))
The text was updated successfully, but these errors were encountered:
看了下源码,是用 query-string 进行转义的,但不清楚是否支持数组。https://github.com/ReactTraining/history/blob/44bc923/modules/useQueries.js#L9-L11
你可以自行用 query-string 转转看。
Sorry, something went wrong.
@yinxuan1128 可以用
// 跳转 this.props.dispatch(routerRedux.push({ pathname: '', state: { searchTags: [] }, })); // 获取 this.props.location.state;
No branches or pull requests
dispatch(routerRedux.push({ pathname: location.pathname, query: { ...value, searchTags:tags, page: 1, pageSize, }, }))
这里searchTags是一个数组,但是上面的写法不能正确获取结果,url上的参数显示是searchTags=XXX,如果把url参数改成searchTags[]=XXX就可以获得正确结果,那么怎么在query里面定义数组参数呢?我试着改成searchTags[]:tags,但是程序报错了
The text was updated successfully, but these errors were encountered: