Merge pull request #968 from MarvinWilliam/hotfix/formCommit
fix form default submit behavior.
This commit is contained in:
commit
3f17939d8e
1 changed files with 7 additions and 2 deletions
|
@ -1,5 +1,7 @@
|
||||||
<template>
|
<template>
|
||||||
<form :class="classes"><slot></slot></form>
|
<form :class="classes" @submit="formSubmit">
|
||||||
|
<slot></slot>
|
||||||
|
</form>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
// https://github.com/ElemeFE/element/blob/dev/packages/form/src/form.vue
|
// https://github.com/ElemeFE/element/blob/dev/packages/form/src/form.vue
|
||||||
|
@ -75,6 +77,9 @@
|
||||||
if (!field) { throw new Error('[iView warn]: must call validateField with valid prop string!'); }
|
if (!field) { throw new Error('[iView warn]: must call validateField with valid prop string!'); }
|
||||||
|
|
||||||
field.validate('', cb);
|
field.validate('', cb);
|
||||||
|
},
|
||||||
|
formSubmit(event){
|
||||||
|
event.preventDefault();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
|
@ -93,4 +98,4 @@
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
Loading…
Add table
Reference in a new issue