handleSubmit = e => {
e.preventDefault();
const { dispatch, form } = this.props;
const isNewRecord = this.props.isNewRecord;
// 获得URL参数
const query_params = new URLSearchParams(this.props.location.search);
const department_id = query_params .get('department_id');
form.validateFields((err, values) => {
if (!err) {
const formVlaue = {
...values
};
console.log("formVlaue",formVlaue);
if (isNewRecord) {
dispatch({ type: "department/userEdit", payload: { department_id:department_id,...formVlaue } });
}
}
});
};
React 获取 url 参数传值页面
猜你喜欢
转载自blog.csdn.net/xh_960125/article/details/86311677
今日推荐
周排行