我使用tiptap-vuetify编辑器,然后尝试添加tables as native extension。
我添加了本项目自述文件中描述的本机扩展名:
...
<tiptap-vuetify v-model="content" :extensions="extensions" :native-extensions="nativeExtensions">
</tiptap-vuetify>
....
nativeExtensions: [
new Table(),
new TableCell(),
new TableHeader(),
new TableRow(),
],
在这一点上,我知道按钮不会自动添加到工具栏,但是我不知道如何手动添加按钮。 自述文件中的示例代码对我不起作用:
<tiptap-vuetify
v-model="content"
:extensions="extensions"
:toolbar-attributes="{ color: 'yellow' }"
>
<template #toolbar="{ buttons, commands, isActive }">
<!--You can render the buttons as you wish (you can see in the source code how this is done).-->
<pre>{{ buttons }}</pre>
</template>
</tiptap-vuetify>
这会产生错误,因为从不使用commands
和isActive
。我尝试通过添加来自the table example的类toolbar
的div来解决此问题,但这还是行不通的。
如何呈现本机扩展中的按钮,包括扩展中的所有其他标准按钮?
我对此很感兴趣,因为将来我想编写自己的扩展并将按钮打印到工具栏上。
感谢帮助!