methods: {
handleSubmit(index, row) {
this.$refs['ruleForm'].validate((valid) => {
if (valid) {
const form = {
login: row.login,
realname: row.realname,
nickname: row.nickname,
mobile: row.mobile
}
axios({
url: '/api/member/import/retry',
method: 'post',
params: form
}).then(response => {
this.$notify({
title: '成功',
message: '重试成功!',
type: 'success'
})
this.list.splice(index, 1)
}).catch(error => {
this.$notify({
title: '失败',
message: error.response.data,
type: 'error'
})
})
}
})
}
}
通过在handleSubmit方法中调用Axios传递form表单(放在params中),对返回做then success和catch error处理