Chore: replace var with let and const (#9774)

This commit is contained in:
阿林
2018-02-11 16:37:58 +08:00
committed by 杨奕
parent c4ac575f3c
commit ad07722aab
8 changed files with 30 additions and 30 deletions

View File

@@ -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');