0.10.57 • Published 2 years ago

5e-editor v0.10.57

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

editor

  1. 具有@功能的编辑器, 由于回显的中文是通过 企业微信的 open-data 组件

how to

  • yarn start 开启本地调试功能

  • yarn build 本地打包

项目结构

src - component 基础组件 - editor 编辑器组件 - element 渲染的节点类型 - global 全局的文件 - leaf 行内的样式: 加粗,下划线... - plugins 插件模块

interface Props {
  // readonly 编辑器是否
  readonly: boolean
  // value
  data?: any[]
  // selectArr 可以被选中的人
  selectArr?: any[]

  // insetNodes (外部插入节点: 重置 + 插入)
  operateNodes?: {
    type: string
    nodes: any // 
  } // {type: 'insert', nodes: {openId: 'xxx', type:'useName', id: 666}}
  // className
  classNames?: string
  // mentionPosition @出现的位置 pc端使用
  mentionPosition?: {
    top?: boolean
    right?: boolean
  }
  // changeValue
  changeValue?(s: any): void

  // search 开始搜索
  onSearch?(s: string): void
}

TODO

  • 拓展plugins, 支持开箱即用的方式
  • 解偶硬编码, 发布成插件的使用

参考文章

  1. api文档