fix(tiptap): update placeholder in case of language change (#896)
This commit is contained in:
parent
886e2d6b73
commit
68d0d48199
|
@ -58,7 +58,7 @@ export function useTiptap(options: UseTiptapOptions) {
|
||||||
suggestion: HashtagSuggestion,
|
suggestion: HashtagSuggestion,
|
||||||
}),
|
}),
|
||||||
Placeholder.configure({
|
Placeholder.configure({
|
||||||
placeholder: placeholder.value,
|
placeholder: () => placeholder.value!,
|
||||||
}),
|
}),
|
||||||
CodeBlockShiki,
|
CodeBlockShiki,
|
||||||
Extension.create({
|
Extension.create({
|
||||||
|
@ -106,6 +106,9 @@ export function useTiptap(options: UseTiptapOptions) {
|
||||||
return
|
return
|
||||||
editor.value?.commands.setContent(value || '', false)
|
editor.value?.commands.setContent(value || '', false)
|
||||||
})
|
})
|
||||||
|
watch(placeholder, () => {
|
||||||
|
editor.value?.view.dispatch(editor.value?.state.tr)
|
||||||
|
})
|
||||||
|
|
||||||
return {
|
return {
|
||||||
editor,
|
editor,
|
||||||
|
|
Loading…
Reference in a new issue