mirror of https://github.com/ElemeFE/element
remove errorMessage when prompt is closed
parent
3d18463415
commit
4ac3118687
|
@ -5,6 +5,8 @@
|
||||||
*2016-XX-XX*
|
*2016-XX-XX*
|
||||||
|
|
||||||
- 修复 Form reset method 对日期控件不起效的问题
|
- 修复 Form reset method 对日期控件不起效的问题
|
||||||
|
- 修复 Dialog 和 Message Box 在 body 无溢出时错误地添加 padding-right 的问题
|
||||||
|
- 修复 Message Box 的 prompt 在打开时会携带之前的验证状态的问题
|
||||||
|
|
||||||
#### 非兼容性更新
|
#### 非兼容性更新
|
||||||
|
|
||||||
|
|
|
@ -143,7 +143,7 @@
|
||||||
this.$prompt('请输入邮箱', '提示', {
|
this.$prompt('请输入邮箱', '提示', {
|
||||||
inputPattern: /[\w!#$%&'*+/=?^_`{|}~-]+(?:\.[\w!#$%&'*+/=?^_`{|}~-]+)*@(?:[\w](?:[\w-]*[\w])?\.)+[\w](?:[\w-]*[\w])?/,
|
inputPattern: /[\w!#$%&'*+/=?^_`{|}~-]+(?:\.[\w!#$%&'*+/=?^_`{|}~-]+)*@(?:[\w](?:[\w-]*[\w])?\.)+[\w](?:[\w-]*[\w])?/,
|
||||||
inputErrorMessage: '邮箱格式不正确'
|
inputErrorMessage: '邮箱格式不正确'
|
||||||
}).then(value => {
|
}).then(({ value }) => {
|
||||||
this.$message({
|
this.$message({
|
||||||
type: 'success',
|
type: 'success',
|
||||||
message: '你的邮箱是: ' + value
|
message: '你的邮箱是: ' + value
|
||||||
|
|
|
@ -140,19 +140,23 @@
|
||||||
},
|
},
|
||||||
|
|
||||||
watch: {
|
watch: {
|
||||||
inputValue() {
|
inputValue(val) {
|
||||||
if (this.$type === 'prompt') {
|
if (this.$type === 'prompt' && val !== null) {
|
||||||
this.validate();
|
this.validate();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
value(val) {
|
value(val) {
|
||||||
if (val && this.$type === 'prompt') {
|
if (this.$type !== 'prompt') return;
|
||||||
|
if (val) {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
if (this.$refs.input && this.$refs.input.$el) {
|
if (this.$refs.input && this.$refs.input.$el) {
|
||||||
this.$refs.input.$el.querySelector('input').focus();
|
this.$refs.input.$el.querySelector('input').focus();
|
||||||
}
|
}
|
||||||
}, 500);
|
}, 500);
|
||||||
|
} else {
|
||||||
|
this.editorErrorMessage = '';
|
||||||
|
removeClass(this.$refs.input.$el.querySelector('input'), 'invalid');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue