chore: fix error, improve ui

This commit is contained in:
fantasticit 2022-09-15 23:30:34 +08:00
parent bb060b2729
commit 48f7b5f168
4 changed files with 9 additions and 8 deletions

View File

@ -62,7 +62,7 @@ export const DocumentEditor: React.FC<IProps> = ({ documentId }) => {
{document && (
<DocumentActions organizationId={document.organizationId} wikiId={document.wikiId} documentId={documentId} />
)}
<DocumentVersion documentId={documentId} onSelect={triggerUseDocumentVersion} />
<DocumentVersion key={'edit'} documentId={documentId} onSelect={triggerUseDocumentVersion} />
</Space>
),
[documentId, document, authority]

View File

@ -25,7 +25,6 @@
main {
padding: 24px;
overflow: auto;
background-color: var(--semi-color-bg-0);
flex: 1;
&.isMobile {

View File

@ -126,8 +126,8 @@ export const DocumentVersion: React.FC<Partial<IProps>> = ({ documentId, onSelec
</Select>
<div style={{ paddingLeft: '8px' }}></div>
<Space style={{ marginLeft: 12 }}>
<Tag style={{ backgroundColor: '#e9ffe9' }}></Tag>
<Tag style={{ backgroundColor: '#ffeaea' }}></Tag>
<Tag style={{ backgroundColor: '#e9ffe9', color: '#333' }}></Tag>
<Tag style={{ backgroundColor: '#ffeaea', color: '#333' }}></Tag>
</Space>
</div>
)}
@ -156,8 +156,8 @@ export const DocumentVersion: React.FC<Partial<IProps>> = ({ documentId, onSelec
empty={!loading && !data.length}
normalContent={() => (
<div className={styles.contentWrap}>
<main className={cls('container', isMobile && styles.isMobile)}>
<div>
<main className={cls(isMobile && styles.isMobile)}>
<div className="container">
{diffVersion ? (
<div id="diff-visual" className="ProseMirror"></div>
) : (

View File

@ -26,7 +26,9 @@ export const useEditor = (options: Partial<EditorOptions> = {}, 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<EditorOptions> = {}, deps: Dependency
instance.on(
'update',
throttle(() => {
instance.chain().focus().scrollIntoView().run();
// instance.chain().focus().scrollIntoView().run();
}, 200)
);
}