From 48f7b5f1689fb0a27dce1835cc3d3ab8555727a4 Mon Sep 17 00:00:00 2001 From: fantasticit Date: Thu, 15 Sep 2022 23:30:34 +0800 Subject: [PATCH] chore: fix error, improve ui --- packages/client/src/components/document/editor/index.tsx | 2 +- .../src/components/document/version/index.module.scss | 1 - packages/client/src/components/document/version/index.tsx | 8 ++++---- packages/client/src/tiptap/core/index.tsx | 6 ++++-- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/packages/client/src/components/document/editor/index.tsx b/packages/client/src/components/document/editor/index.tsx index 3a00816f..f4560169 100644 --- a/packages/client/src/components/document/editor/index.tsx +++ b/packages/client/src/components/document/editor/index.tsx @@ -62,7 +62,7 @@ export const DocumentEditor: React.FC = ({ documentId }) => { {document && ( )} - + ), [documentId, document, authority] diff --git a/packages/client/src/components/document/version/index.module.scss b/packages/client/src/components/document/version/index.module.scss index 4cb062cc..59604b21 100644 --- a/packages/client/src/components/document/version/index.module.scss +++ b/packages/client/src/components/document/version/index.module.scss @@ -25,7 +25,6 @@ main { padding: 24px; overflow: auto; - background-color: var(--semi-color-bg-0); flex: 1; &.isMobile { diff --git a/packages/client/src/components/document/version/index.tsx b/packages/client/src/components/document/version/index.tsx index fff5b593..403c6b5e 100644 --- a/packages/client/src/components/document/version/index.tsx +++ b/packages/client/src/components/document/version/index.tsx @@ -126,8 +126,8 @@ export const DocumentVersion: React.FC> = ({ documentId, onSelec
对比
- 增加的内容 - 删除的内容 + 增加的内容 + 删除的内容 )} @@ -156,8 +156,8 @@ export const DocumentVersion: React.FC> = ({ documentId, onSelec empty={!loading && !data.length} normalContent={() => (
-
-
+
+
{diffVersion ? (
) : ( diff --git a/packages/client/src/tiptap/core/index.tsx b/packages/client/src/tiptap/core/index.tsx index 538ea1c1..87be85c4 100644 --- a/packages/client/src/tiptap/core/index.tsx +++ b/packages/client/src/tiptap/core/index.tsx @@ -26,7 +26,9 @@ export const useEditor = (options: Partial = {}, deps: Dependency options.editorProps = options.editorProps || {}; if (options.editable) { - options.editorProps.attributes = options.editorProps.attributes || {}; + options.editorProps.attributes = options.editorProps.attributes || { + spellcheck: 'false', + }; // @ts-ignore options.editorProps.attributes.class = options.editorProps.attributes.class || ''; // @ts-ignore @@ -41,7 +43,7 @@ export const useEditor = (options: Partial = {}, deps: Dependency instance.on( 'update', throttle(() => { - instance.chain().focus().scrollIntoView().run(); + // instance.chain().focus().scrollIntoView().run(); }, 200) ); }