remove errorMessage when prompt is closed

This commit is contained in:
Leopoldthecoder
2016-10-17 12:42:02 +08:00
committed by cinwell.li
parent 3d18463415
commit 4ac3118687
3 changed files with 10 additions and 4 deletions

View File

@@ -140,19 +140,23 @@
},
watch: {
inputValue() {
if (this.$type === 'prompt') {
inputValue(val) {
if (this.$type === 'prompt' && val !== null) {
this.validate();
}
},
value(val) {
if (val && this.$type === 'prompt') {
if (this.$type !== 'prompt') return;
if (val) {
setTimeout(() => {
if (this.$refs.input && this.$refs.input.$el) {
this.$refs.input.$el.querySelector('input').focus();
}
}, 500);
} else {
this.editorErrorMessage = '';
removeClass(this.$refs.input.$el.querySelector('input'), 'invalid');
}
}
},