From 3b30154048605d42bd6d2ae191dd558d09f65b9a Mon Sep 17 00:00:00 2001 From: wkj <278599135@qq.com> Date: Mon, 3 Jul 2023 11:45:08 +0800 Subject: [PATCH] lib --- lib/pages/article/preview/index.js | 6 +---- src/pages/article/preview/index.ts | 2 -- src/pages/article/preview/web.tsx | 37 +++++++++++++++--------------- 3 files changed, 19 insertions(+), 26 deletions(-) diff --git a/lib/pages/article/preview/index.js b/lib/pages/article/preview/index.js index a76f057ed..a9cb2290e 100644 --- a/lib/pages/article/preview/index.js +++ b/lib/pages/article/preview/index.js @@ -9,9 +9,7 @@ exports.default = OakComponent({ content: 1, articleMenu: { id: 1, - }, - entity: 1, - entityId: 1, + } }, formData: function (_a) { var article = _a.data, features = _a.features; @@ -19,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: { diff --git a/src/pages/article/preview/index.ts b/src/pages/article/preview/index.ts index 95e4acfdb..d7fdfcb24 100644 --- a/src/pages/article/preview/index.ts +++ b/src/pages/article/preview/index.ts @@ -16,8 +16,6 @@ export default OakComponent({ id: article?.id, content: article?.content, name: article?.name, - // entity: article?.entity, - // entityId: article?.entityId, }; }, // listeners: { diff --git a/src/pages/article/preview/web.tsx b/src/pages/article/preview/web.tsx index 7f33f190a..12c04cc55 100644 --- a/src/pages/article/preview/web.tsx +++ b/src/pages/article/preview/web.tsx @@ -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, @@ -28,16 +27,16 @@ export default function Render( ) { const { id, name, editor, title, content } = props.data; const editorConfig: Partial = { - 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 (
@@ -48,15 +47,15 @@ export default function Render( {/*
{author}
*/} -
- +
+