From 5c84aa1211bc394d244ae797ab0de6be340af7fb Mon Sep 17 00:00:00 2001 From: fantasticit Date: Thu, 31 Mar 2022 23:06:16 +0800 Subject: [PATCH] fix: use default empty content for editor --- packages/client/src/components/document/version/index.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/client/src/components/document/version/index.tsx b/packages/client/src/components/document/version/index.tsx index 9409f4f..dcb5b29 100644 --- a/packages/client/src/components/document/version/index.tsx +++ b/packages/client/src/components/document/version/index.tsx @@ -1,6 +1,6 @@ import React, { useState, useEffect, useCallback } from 'react'; import { Button, Modal, Typography } from '@douyinfe/semi-ui'; -import { IconClose } from '@douyinfe/semi-icons'; +import { IconChevronLeft } from '@douyinfe/semi-icons'; import { useEditor, EditorContent } from '@tiptap/react'; import cls from 'classnames'; import { DEFAULT_EXTENSION, DocumentWithTitle } from 'tiptap'; @@ -26,7 +26,7 @@ export const DocumentVersion: React.FC = ({ documentId, onSelect }) => { const editor = useEditor({ editable: false, extensions: [...DEFAULT_EXTENSION, DocumentWithTitle], - content: {}, + content: { type: 'doc', content: [] }, }); const close = useCallback(() => { @@ -75,7 +75,7 @@ export const DocumentVersion: React.FC = ({ documentId, onSelect }) => { header={
-