mirror of https://github.com/fantasticit/think.git
feat(tiptap): add default tilte
This commit is contained in:
parent
854f796a58
commit
87cb551be4
|
@ -73,7 +73,7 @@ export const EditorInstance = forwardRef((props: IProps, ref) => {
|
||||||
onUpdate({ transaction }) {
|
onUpdate({ transaction }) {
|
||||||
try {
|
try {
|
||||||
const title = transaction.doc.content.firstChild.content.firstChild?.textContent;
|
const title = transaction.doc.content.firstChild.content.firstChild?.textContent;
|
||||||
onTitleUpdate(title);
|
onTitleUpdate(title || '未命名文档');
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
//
|
//
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue