UEditor中默认只有文字超出数量限制提醒功能,但还是可以保存

网上都说找到配置文件注释两行加三行,我试了没有生效

然后打印了这个元素,最后找到文本字段,这里用的是vue中的ref选择器:
html

<vue-ueditor-wrap
                ref="ue"
                v-model="ruleFormLi.declareContext"
                :config="ueConfig"
              ></vue-ueditor-wrap>

js

 console.log(this.$refs.ue.editor.body.innerText);   //文本内容 
 if (this.$refs.ue.editor.body.innerText.length > 10000) {
        this.$message.error("字数超长");
        return;
      }
Logo

前往低代码交流专区

更多推荐