Browse Source

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

es6
Vivy.Pan 1 year ago
parent
commit
f5f8615df0
  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