Skip to content

Inline 工具栏

Inline Editor 通过 toolbar: InlineToolbarConfig 控制工具栏与扩展注册。

默认

ts
{ undoRedo: true, textFormat: true, link: true }

全部开关

扩展 / UI说明
undoRedoStarterKit history撤销 / 重做
headingStarterKit heading标题级别
textFormatbold/italic/underline/strike文本格式
listTaskList有序 / 无序 / 任务列表
alignTextAlign对齐
linkLink + 链接气泡插入链接
clearFormat清除格式
fontFontFamily + FontSize字体族与字号
codeBlockcodeBlockLowlight代码块

规则toolbar.x !== true 时,对应按钮隐藏且扩展不注册。

示例

vue
<YanivInlineEditor
  v-model:content="html"
  mode="edit"
  placeholder="写评论…"
  :toolbar="{
    undoRedo: true,
    heading: true,
    textFormat: true,
    list: true,
    align: true,
    link: true,
    clearFormat: true,
    font: false,
    codeBlock: false,
  }"
/>

自定义插槽

使用 #toolbar 插槽 + 原子组件自行拼装,见 Inline 按需拼装

预览

mode="preview" 时不渲染内置工具栏与 #toolbar slot。

相关