wangEditor自动获取焦点

简介: wangEditor自动获取焦点

wangEditor自动获取焦点

官网:wangEditor

在onCreated加focus

<template>
    <div style="border: 1px solid #ccc">
      <Toolbar
        style="border-bottom: 1px solid #ccc"
        :editor="editorRef"
        :defaultConfig="toolbarConfig"
        :mode="mode"
      />
      <Editor
        style="height: 500px; overflow-y: hidden;"
        v-model="valueHtml"
        :defaultConfig="editorConfig"
        :mode="mode"
        @onCreated="handleCreated"
      />
    </div>
</template>
const handleCreated = (editors) => {
   
editors.focus(true);
}

结束

// 伪代码
import {
    IDomEditor } from '@wangeditor/editor'

let editor: IDomEditor | null = null

ajax(url, res => {
   
  editor = createEditor({
   
    // content 或 html
    // 其他属性
  })
})// 伪代码
import {
    IDomEditor } from '@wangeditor/editor'

let editor: IDomEditor | null = null

ajax(url, res => {
   
  editor = createEditor({
   
    // content 或 html
    // 其他属性
  })
})// 伪代码
import {
    IDomEditor } from '@wangeditor/editor'

let editor: IDomEditor | null = null

ajax(url, res => {
   
  editor = createEditor({
   
    // content 或 html
    // 其他属性
  })
})// 伪代码
import {
    IDomEditor } from '@wangeditor/editor'

let editor: IDomEditor | null = null

ajax(url, res => {
   
  editor = createEditor({
   
    // content 或 html
    // 其他属性
  })
})// 伪代码
import {
    IDomEditor } from '@wangeditor/editor'

let editor: IDomEditor | null = null

ajax(url, res => {
   
  editor = createEditor({
   
    // content 或 html
    // 其他属性
  })
})// 伪代码
import {
    IDomEditor } from '@wangeditor/editor'

let editor: IDomEditor | null = null

ajax(url, res => {
   
  editor = createEditor({
   
    // content 或 html
    // 其他属性
  })
})// 伪代码
import {
    IDomEditor } from '@wangeditor/editor'

let editor: IDomEditor | null = null

ajax(url, res => {
   
  editor = createEditor({
   
    // content 或 html
    // 其他属性
  })
})// 伪代码
import {
    IDomEditor } from '@wangeditor/editor'

let editor: IDomEditor | null = null

ajax(url, res => {
   
  editor = createEditor({
   
    // content 或 html
    // 其他属性
  })
})// 伪代码
import {
    IDomEditor } from '@wangeditor/editor'

let editor: IDomEditor | null = null

ajax(url, res => {
   
  editor = createEditor({
   
    // content 或 html
    // 其他属性
  })
})// 伪代码
import {
    IDomEditor } from '@wangeditor/editor'

let editor: IDomEditor | null = null

ajax(url, res => {
   
  editor = createEditor({
   
    // content 或 html
    // 其他属性
  })
})// 伪代码
import {
    IDomEditor } from '@wangeditor/editor'

let editor: IDomEditor | null = null

ajax(url, res => {
   
  editor = createEditor({
   
    // content 或 html
    // 其他属性
  })
})// 伪代码
import {
    IDomEditor } from '@wangeditor/editor'

let editor: IDomEditor | null = null

ajax(url, res => {
   
  editor = createEditor({
   
    // content 或 html
    // 其他属性
  })
})// 伪代码
import {
    IDomEditor } from '@wangeditor/editor'

let editor: IDomEditor | null = null

ajax(url, res => {
   
  editor = createEditor({
   
    // content 或 html
    // 其他属性
  })
})// 伪代码
import {
    IDomEditor } from '@wangeditor/editor'

let editor: IDomEditor | null = null

ajax(url, res => {
   
  editor = createEditor({
   
    // content 或 html
    // 其他属性
  })
})// 伪代码
import {
    IDomEditor } from '@wangeditor/editor'

let editor: IDomEditor | null = null

ajax(url, res => {
   
  editor = createEditor({
   
    // content 或 html
    // 其他属性
  })
})// 伪代码
import {
    IDomEditor } from '@wangeditor/editor'

let editor: IDomEditor | null = null

ajax(url, res => {
   
  editor = createEditor({
   
    // content 或 html
    // 其他属性
  })
})// 伪代码
import {
    IDomEditor } from '@wangeditor/editor'

let editor: IDomEditor | null = null

ajax(url, res => {
   
  editor = createEditor({
   
    // content 或 html
    // 其他属性
  })
})// 伪代码
import {
    IDomEditor } from '@wangeditor/editor'

let editor: IDomEditor | null = null

ajax(url, res => {
   
  editor = createEditor({
   
    // content 或 html
    // 其他属性
  })
})// 伪代码
import {
    IDomEditor } from '@wangeditor/editor'

let editor: IDomEditor | null = null

ajax(url, res => {
   
  editor = createEditor({
   
    // content 或 html
    // 其他属性
  })
})// 伪代码
import {
    IDomEditor } from '@wangeditor/editor'

let editor: IDomEditor | null = null

ajax(url, res => {
   
  editor = createEditor({
   
    // content 或 html
    // 其他属性
  })
})// 伪代码
import {
    IDomEditor } from '@wangeditor/editor'

let editor: IDomEditor | null = null

ajax(url, res => {
   
  editor = createEditor({
   
    // content 或 html
    // 其他属性
  })
})// 伪代码
import {
    IDomEditor } from '@wangeditor/editor'

let editor: IDomEditor | null = null

ajax(url, res => {
   
  editor = createEditor({
   
    // content 或 html
    // 其他属性
  })
})// 伪代码
import {
    IDomEditor } from '@wangeditor/editor'

let editor: IDomEditor | null = null

ajax(url, res => {
   
  editor = createEditor({
   
    // content 或 html
    // 其他属性
  })
})// 伪代码
import {
    IDomEditor } from '@wangeditor/editor'

let editor: IDomEditor | null = null

ajax(url, res => {
   
  editor = createEditor({
   
    // content 或 html
    // 其他属性
  })
})// 伪代码
import {
    IDomEditor } from '@wangeditor/editor'

let editor: IDomEditor | null = null

ajax(url, res => {
   
  editor = createEditor({
   
    // content 或 html
    // 其他属性
  })
})
目录
相关文章
vue3 wangEditor富文本自定义上传本地图片
Vue3和WangEditor都提供了上传本地图片的功能,可以结合使用实现自定义上传本地图片。
1705 0
|
12月前
vue3+Ts 二次封装ElementUI form表单
【10月更文挑战第8天】
831 59
|
数据可视化 物联网
Threejs物联网,工厂3D可视化
Threejs物联网,工厂3D可视化
1061 15
Threejs物联网,工厂3D可视化
|
JavaScript 前端开发 API
【面试题】当面试官问 Vue2与Vue3的区别,你该怎么回答?
【面试题】当面试官问 Vue2与Vue3的区别,你该怎么回答?
352 0
|
JavaScript 前端开发 测试技术
|
3月前
|
移动开发 监控 开发者
webuploader上传插件源代码重点难点分析
WebUploader 是一个基于 HTML5 的文件上传插件,提供了多种功能和交互方式,支持拖拽、选择文件、分片上传、图片预览、上传进度等特性。它兼容主流浏览器,并且能够应对复杂的上传需求,如大文件上传和断点续传。 在分析 WebUploader 的源代码时,重点可以放在文件上传的核心功能、事件管理、拖拽上传、进度显示、分片上传的实现方式等方面。 以下是对 WebUploader 源代码的重点和难点的分析。
160 4
|
JavaScript 前端开发
JS之url进行编码和解码(三种方式)
JS之url进行编码和解码(三种方式)
19548 2
|
4月前
|
Java API 数据库
JPA简介:Spring Boot环境下的实践指南
上述内容仅是JPA在Spring Boot环境下使用的冰山一角,实际的实践中你会发现更深更广的应用。总而言之,只要掌握了JPA的规则,你就可以借助Spring Boot无比丰富的功能,娴熟地驾驶这台高性能的跑车,在属于你的程序世界里驰骋。
158 15
|
JavaScript
基于Vue2.X对WangEditor 5富文本编辑器进行封装与使用,支持单个或多个图片点击、粘贴、拖拽上传,Vue3.X项目也可直接使用
这篇文章介绍了如何在Vue 2.X项目中封装和使用WangEditor 5富文本编辑器,支持图片的点击、粘贴和拖拽上传,同时提到封装的组件也适用于Vue 3.X项目,并提供了详细的使用示例和后端配置。
1568 1
基于Vue2.X对WangEditor 5富文本编辑器进行封装与使用,支持单个或多个图片点击、粘贴、拖拽上传,Vue3.X项目也可直接使用
|
JavaScript Java 测试技术
基于SpringBoot+Vue的高校学生奖学金评定系统的详细设计和实现(源码+lw+部署文档+讲解等)
基于SpringBoot+Vue的高校学生奖学金评定系统的详细设计和实现(源码+lw+部署文档+讲解等)
152 1