updateAttrs on EditorMenus ?
See original GitHub issueIn #622 there was getNodeAttr
added. But to update a node, such as setting the alt
of an image, we need updateAttrs
? I assumed I could do something like this, but that fails:
<editor-menu-bubble
v-slot="{ commands, isActive, getNodeAttrs, updateAttrs, getMarkAttrs, menu }"
:editor="editor"
keep-in-bounds
>
<div>
</div>
</editor-menu-bubble>
<script>
[...]
imageAlt: {
get () {
return this.getNodeAttrs('image').alt // .alt , .src or .title
},
set (value) {
const alt = value
this.updateAttrs({ alt )
console.log('alt was set to', this.getNodeAttrs('image').alt)
}
},
[...]
</script>
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:5 (2 by maintainers)
Top Results From Across the Web
updateAttrs on EditorMenus ? · Issue #676 · ueberdosis/tiptap
In #622 there was getNodeAttr added. But to update a node, such as setting the alt of an image, we need updateAttrs?
Read more >Create menus – Tiptap Editor
Most editor menus use icons for their buttons. In some of our demos, we use the open source icon set Remix Icon, which...
Read more >terminal initialRows still isn't working completely right C++ - GitAnswer
tiptap updateAttrs on EditorMenus ? - TypeScript · Allow control over when two values are equal (for dirty checking and to possibly prevent...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
You could create a command that updates the node:
Then in my Vue component I call this:
Hope that helps!
Thanks @gambolputty for sharing! We’ve also added something like that to the upcoming tiptap v2. 👀
Closing this here for now. ✌️