Browse Source

Pull request #3431: KERNEL-14215 fix:bi.editor组件errorText无法更新-bug46

Merge in VISUAL/fineui from ~VIVY.PAN/fineui:es6 to es6

* commit 'f5f8615df0a308beff9f8d0f883bcd994c5c17d9':
  KERNEL-14215 fix:bi.editor组件errorText无法更新-bug46
es6
Vivy.Pan-潘柯芋 2 years ago
parent
commit
2dda96ea65
  1. 9
      src/base/single/editor/editor.js

9
src/base/single/editor/editor.js

@ -232,9 +232,9 @@ export class Editor extends Single {
} }
_checkToolTip() { _checkToolTip() {
const { errorText } = this.options; let errorText = this.options.errorText;
if (isFunction(errorText)) { if (isFunction(errorText)) {
this.options.errorText = errorText(this.editor.getValue()); errorText = errorText(this.editor.getValue());
} }
if (isKey(errorText)) { if (isKey(errorText)) {
if (!this.isEnabled() || this.isValid() || Bubbles.has(this.getName())) { if (!this.isEnabled() || this.isValid() || Bubbles.has(this.getName())) {
@ -324,9 +324,10 @@ export class Editor extends Single {
} }
_setErrorVisible(b) { _setErrorVisible(b) {
const { errorText, autoTrim, simple } = this.options; const { autoTrim, simple } = this.options;
let errorText = this.options.errorText;
if (isFunction(errorText)) { if (isFunction(errorText)) {
this.options.errorText = errorText(autoTrim ? trim(this.editor.getValue()) : this.editor.getValue()); errorText = errorText(autoTrim ? trim(this.editor.getValue()) : this.editor.getValue());
} }
if (!this.disabledError && isKey(errorText)) { if (!this.disabledError && isKey(errorText)) {
Bubbles[b ? "show" : "hide"](this.getName(), errorText, this, { Bubbles[b ? "show" : "hide"](this.getName(), errorText, this, {

Loading…
Cancel
Save