Merge pull request #968 from MarvinWilliam/hotfix/formCommit

fix form default submit behavior.
This commit is contained in:
Aresn 2017-05-22 09:48:35 +08:00 committed by GitHub
commit 3f17939d8e

View file

@ -1,5 +1,7 @@
<template>
<form :class="classes"><slot></slot></form>
<form :class="classes" @submit="formSubmit">
<slot></slot>
</form>
</template>
<script>
// 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!'); }
field.validate('', cb);
},
formSubmit(event){
event.preventDefault();
}
},
watch: {
@ -93,4 +98,4 @@
});
}
};
</script>
</script>