mirror of
https://github.com/ueberdosis/tiptap.git
synced 2024-11-27 23:15:15 +08:00
add check in ComponentView for editable
This commit is contained in:
parent
1cca2947ce
commit
f2b1d1668b
@ -36,6 +36,10 @@ export default class ComponentView {
|
||||
}
|
||||
|
||||
updateAttrs(attrs) {
|
||||
if (!this.editable) {
|
||||
return
|
||||
}
|
||||
|
||||
const transaction = this.view.state.tr.setNodeMarkup(this.getPos(), null, {
|
||||
...this.node.attrs,
|
||||
...attrs,
|
||||
@ -44,6 +48,10 @@ export default class ComponentView {
|
||||
}
|
||||
|
||||
updateContent(content) {
|
||||
if (!this.editable) {
|
||||
return
|
||||
}
|
||||
|
||||
const transaction = this.view.state.tr.setNodeMarkup(this.getPos(), this.node.type, { content })
|
||||
this.view.dispatch(transaction)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user