mirror of
				https://gitee.com/hhyykk/ipms-sjy.git
				synced 2025-11-04 12:18:42 +08:00 
			
		
		
		
	富文本编辑器自动聚焦问题 update yudao-ui-admin/src/components/Editor/index.vue.
修复富文本编辑器自动聚焦问题; 思路:初始化时初始化只读模式的编辑器,因为只读模式的编辑器不会因为聚焦问题带跑滚动条,然后根据传递的是否只读参数设置编辑器是否启用。 Signed-off-by: zbk <540064991@qq.com>
This commit is contained in:
		@@ -84,7 +84,7 @@ export default {
 | 
			
		||||
          ],
 | 
			
		||||
        },
 | 
			
		||||
        placeholder: "请输入内容",
 | 
			
		||||
        readOnly: this.readOnly,
 | 
			
		||||
        readOnly: true,
 | 
			
		||||
      },
 | 
			
		||||
    };
 | 
			
		||||
  },
 | 
			
		||||
@@ -123,6 +123,13 @@ export default {
 | 
			
		||||
    init() {
 | 
			
		||||
      const editor = this.$refs.editor;
 | 
			
		||||
      this.Quill = new Quill(editor, this.options);
 | 
			
		||||
      // 取消自动聚焦 start
 | 
			
		||||
      this.$nextTick(()=>{
 | 
			
		||||
        this.Quill.blur();
 | 
			
		||||
        if(!this.readOnly){
 | 
			
		||||
          this.Quill.enable();
 | 
			
		||||
        }
 | 
			
		||||
      });
 | 
			
		||||
      // 如果设置了上传地址则自定义图片上传事件
 | 
			
		||||
      if (this.type === 'url') {
 | 
			
		||||
        let toolbar = this.Quill.getModule("toolbar");
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user