mirror of
https://github.com/ElemeFE/element.git
synced 2025-12-19 12:04:02 +08:00
Chore: replace var with let and const (#9774)
This commit is contained in:
@@ -213,15 +213,15 @@
|
||||
|
||||
validate() {
|
||||
if (this.$type === 'prompt') {
|
||||
var inputPattern = this.inputPattern;
|
||||
const inputPattern = this.inputPattern;
|
||||
if (inputPattern && !inputPattern.test(this.inputValue || '')) {
|
||||
this.editorErrorMessage = this.inputErrorMessage || t('el.messagebox.error');
|
||||
addClass(this.getInputElement(), 'invalid');
|
||||
return false;
|
||||
}
|
||||
var inputValidator = this.inputValidator;
|
||||
const inputValidator = this.inputValidator;
|
||||
if (typeof inputValidator === 'function') {
|
||||
var validateResult = inputValidator(this.inputValue);
|
||||
const validateResult = inputValidator(this.inputValue);
|
||||
if (validateResult === false) {
|
||||
this.editorErrorMessage = this.inputErrorMessage || t('el.messagebox.error');
|
||||
addClass(this.getInputElement(), 'invalid');
|
||||
|
||||
Reference in New Issue
Block a user