Appearance
文本框 TextBox
给文字加上方框,渲染为 <span class="qp-text-box">。
用法
ts
import { TextBox } from '@qingpai/core'
const editor = new Editor({
extensions: [TextBox],
})配置
| 名称 | 类型 | 默认值 | 描述 |
|---|---|---|---|
HTMLAttributes | Record<string, any> | {} | 渲染到文本框元素上的额外 HTML 属性 |
命令
ts
// 设置文本框
editor.commands.setTextBox()
// 切换文本框
editor.commands.toggleTextBox()
// 取消文本框
editor.commands.unsetTextBox()配套 UI
| 名称 | 说明 |
|---|---|
TextBoxButton | 工具栏文本框按钮 |
Source code
packages/core/src/marks/text-box/