fix(form-item): feedback animation not triggered when it existed at first.

This commit is contained in:
07akioni 2020-05-30 21:29:40 +08:00
parent 37feb27e98
commit 9c8380854f
2 changed files with 4 additions and 9 deletions

View File

@ -7,8 +7,7 @@
[`n-form-item--${syntheticLabelPlacement}-labelled`]: syntheticLabelPlacement,
[`n-form-item--${syntheticLabelAlign}-label-aligned`]: syntheticLabelAlign,
[`n-form-item--required`]: syntheticRequired && syntheticShowRequireMark,
[`n-form-item--no-label`]: !(label || $scopedSlots.label),
[`n-form-item--has-feedback`]: hasFeedback
[`n-form-item--no-label`]: !(label || $scopedSlots.label)
}"
>
<label
@ -184,7 +183,6 @@ export default {
return {
explains: [],
validationErrored: false,
hasFeedback: false,
feedbackTransitionDisabled: true
}
},
@ -283,6 +281,9 @@ export default {
this._initData()
}
},
mounted () {
this.feedbackTransitionDisabled = false
},
created () {
/**
* This is buggy!
@ -295,7 +296,6 @@ export default {
_initData () {
this.explains = []
this.validationErrored = false
this.hasFeedback = false
this.disableFeedbackTransition()
},
handleBeforeLeave (feedback) {
@ -443,10 +443,8 @@ export default {
},
handleBeforeEnter () {
this.feedbackTransitionDisabled = false
this.hasFeedback = true
},
handleAfterLeave () {
this.hasFeedback = false
this.feedbackTransitionDisabled = false
}
}

View File

@ -105,9 +105,6 @@ $form-item-label-height: (
}
}
}
@include m(has-feedback) {
padding-bottom: 0px;
}
@include b(form-item-blank) {
padding-top: 3px;
padding-bottom: 3px;