Skip to content

Commit 40ec2db

Browse files
committed
feat(form): submit method add skipValidate param
skipValidate used to skip validating when submit
1 parent a0fe79d commit 40ec2db

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/components/form/form.vue

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,13 +115,19 @@
115115
}
116116
},
117117
methods: {
118-
submit() {
118+
submit(skipValidate = false) {
119+
this.skipValidate = skipValidate
119120
dispatchEvent(this.$refs.form, 'submit')
121+
this.skipValidate = false
120122
},
121123
reset() {
122124
dispatchEvent(this.$refs.form, 'reset')
123125
},
124126
submitHandler(e) {
127+
if (this.skipValidate) {
128+
this.$emit(EVENT_SUBMIT, e, this.model)
129+
return
130+
}
125131
const submited = (submitResult) => {
126132
if (submitResult) {
127133
this.$emit(EVENT_VALID, this.validity)

0 commit comments

Comments
 (0)