Skip to content

Commit

Permalink
postリクエストで動かなかったバグ修正
Browse files Browse the repository at this point in the history
  • Loading branch information
hosokawat committed Dec 8, 2019
1 parent 434d145 commit a085e51
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 8 deletions.
16 changes: 13 additions & 3 deletions src/components/VAjaxForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,19 @@ module.exports = {
request: function (params) {
const vm = this;
vm.$emit('start', params);
axios[vm.method](vm.action, {
params: params
}).then(function (response) {
let ax_op2 = {};
let _method = vm.method.toLowerCase();
switch (vm.method) {
case 'get':
ax_op2 = {params: params};
break;
case 'post':
ax_op2 = params;
break;
}
axios[_method](vm.action,
ax_op2
).then(function (response) {
vm.$emit('receive', response);
}).catch(function (response) {
vm.$emit('fail', response);
Expand Down
17 changes: 13 additions & 4 deletions v-ajax-form.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion v-ajax-form.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit a085e51

Please sign in to comment.