Skip to content

文本框 TextBox ​

给文字加上方框,渲染为 <span class="qp-text-box">。

用法 ​

ts
import { TextBox } from '@qingpai/core'

const editor = new Editor({
  extensions: [TextBox],
})

配置 ​

名称类型默认值描述
HTMLAttributesRecord<string, any>{}渲染到文本框元素上的额外 HTML 属性

命令 ​

ts
// 设置文本框
editor.commands.setTextBox()

// 切换文本框
editor.commands.toggleTextBox()

// 取消文本框
editor.commands.unsetTextBox()

配套 UI ​

名称说明
TextBoxButton工具栏文本框按钮

Source code ​

  • packages/core/src/marks/text-box/

轻排编辑器 — 教育领域富文本编辑器