docs: function () {
          const toolbarSelector = this.toolbarSelector
          const $toolbarSelector = $(toolbarSelector)
          const textSelector = this.textSelector
  
          const config = this.config
          const zIndex = config.zIndex
  
          // 定义变量
          let $toolbarElem, $textContainerElem, $textElem, $children
  
          if (textSelector == null) {
              // 只传入一个参数，即是容器的选择器或元素，toolbar 和 text 的元素自行创建
              $toolbarElem = $('<div></div>')
              $textContainerElem = $('<div></div>')
  
              // 将编辑器区域原有的内容，暂存起来
              $children = $toolbarSelector.children()
  
              // 添加到 DOM 结构中
              $toolbarSelector.append($toolbarElem).append($textContainerElem)
  
              // 自行创建的，需要配置默认的样式
              $toolbarElem.css('background-color', '#f1f1f1')
                              .css('border', '1px solid #ccc')
              $textContainerElem.css('border', '1px solid #ccc')
                              .css('border-top', 'none')
                              .css('height', '300px')
          } else {
              // toolbar 和 text 的选择器都有值，记录属性
              $toolbarElem = $toolbarSelector
              $textContainerElem = $(textSelector)
              // 将编辑器区域原有的内容，暂存起来
              $children = $textContainerElem.children()
          }
  
          // 编辑区域
          $textElem = $('<div></div>')
          $textElem.attr('contenteditable', 'true')
                  .css('width', '100%')
                  .css('height', '100%')
  
          // 初始化编辑区域内容
          if ($children && $children.length) {
              $textElem.append($children)
          } else {
              $textElem.append($('<p><br></p>'))
          }
  
          // 编辑区域加入DOM
          $textContainerElem.append($textElem)
  
          // 设置通用的 class
          $toolbarElem.addClass('w-e-toolbar')
          $textContainerElem.addClass('w-e-text-container')
          $textContainerElem.css('z-index', zIndex)
          $textElem.addClass('w-e-text')
  
          // 添加 ID
          const toolbarElemId = getRandom('toolbar-elem')
          $toolbarElem.attr('id', toolbarElemId)
          const textElemId = getRandom('text-elem')
          $textElem.attr('id', textElemId)
  
          // 记录属性
          this.$toolbarElem = $toolbarElem
          this.$textContainerElem = $textContainerElem
          this.$textElem = $textElem
          this.toolbarElemId = toolbarElemId
          this.textElemId = textElemId
  
          // 记录输入法的开始和结束
          let compositionEnd = true
          $textContainerElem.on('compositionstart', () => {
              // 输入法开始输入
              compositionEnd = false
          })
          $textContainerElem.on('compositionend', () => {
              // 输入法结束输入
              compositionEnd = true
          })
  
          // 绑定 onchange
          $textContainerElem.on('click keyup', () => {
              // 输入法结束才出发 onchange
              compositionEnd && this.change &&  this.change()
          })
          $toolbarElem.on('click', function () {
              this.change &&  this.change()
          })
  
          //绑定 onfocus 与 onblur 事件
          if(config.onfocus || config.onblur){
              // 当前编辑器是否是焦点状态
              this.isFocus = false
              
              $(document).on('click', (e) => {
                  //判断当前点击元素是否在编辑器内
                  const isChild = $textElem.isContain($(e.target))
                  
                  //判断当前点击元素是否为工具栏
                  const isToolbar = $toolbarElem.isContain($(e.target))
                  const isMenu = $toolbarElem[0] == e.target ? true : false
  
                  if (!isChild) {
                      //若为选择工具栏中的功能，则不视为成blur操作
                      if(isToolbar && !isMenu){
                          return
                      }
  
                      if(this.isFocus){
                          this.onblur && this.onblur()
                      }
                      this.isFocus = false
                  }else{
                      if(!this.isFocus){
                          this.onfocus && this.onfocus()
                      }
                      this.isFocus = true
                  }
              })
          }
  
      }