Merge branch 'dev' of codeup.aliyun.com:61c14a7efa282c88e103c23f/oak-general-business into dev

This commit is contained in:
qsc 2023-07-03 13:09:00 +08:00
commit e7a3fbee7d
3 changed files with 18 additions and 23 deletions

View File

@ -17,8 +17,6 @@ exports.default = OakComponent({
id: article === null || article === void 0 ? void 0 : article.id,
content: article === null || article === void 0 ? void 0 : article.content,
name: article === null || article === void 0 ? void 0 : article.name,
// entity: article?.entity,
// entityId: article?.entityId,
};
},
// listeners: {

View File

@ -16,8 +16,6 @@ export default OakComponent({
id: article?.id,
content: article?.content,
name: article?.name,
// entity: article?.entity,
// entityId: article?.entityId,
};
},
// listeners: {

View File

@ -2,11 +2,10 @@ import React from 'react';
import Style from './web.module.less';
import { WebComponentProps } from 'oak-frontend-base';
import { EntityDict } from '../../../general-app-domain';
import { Editor } from "@wangeditor/editor-for-react";
import { IEditorConfig } from "@wangeditor/editor";
import { Editor } from '@wangeditor/editor-for-react';
import { IEditorConfig } from '@wangeditor/editor';
import { useState, useEffect } from 'react';
export default function Render(
props: WebComponentProps<
EntityDict,
@ -29,16 +28,16 @@ export default function Render(
const { id, name, editor, title, content } = props.data;
console.log(title, content)
const editorConfig: Partial<IEditorConfig> = {
readOnly: true,
autoFocus: true,
scroll: false,
readOnly: true,
autoFocus: true,
scroll: false,
};
const [value, setValue] = useState('');
useEffect(() => {
if(content) {
setValue(content)
}
},[content]);
if (content) {
setValue(content);
}
}, [content]);
return (
<div className={Style.container}>
<div className={Style.content}>
@ -49,15 +48,15 @@ export default function Render(
{/* <div className={Style.authorContainer}>
<span className={Style.author}>{author}</span>
</div> */}
<div id="article-content" style={{width:"100%"}}>
<Editor
defaultConfig={editorConfig}
value={value}
mode="default"
style={{
width: '100%'
}}
/>
<div id="article-content" style={{ width: '100%' }}>
<Editor
defaultConfig={editorConfig}
value={value}
mode="default"
style={{
width: '100%',
}}
/>
</div>
</div>
</div>