Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
sass-admin
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hqzhdj_app
sass-admin
Commits
360a5b28
Commit
360a5b28
authored
Jun 03, 2025
by
end
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改资讯
parent
bf8b49da
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
7 deletions
+5
-7
dist.zip
+0
-0
src/common/Editor/editor.js
+5
-7
No files found.
dist.zip
View file @
360a5b28
No preview for this file type
src/common/Editor/editor.js
View file @
360a5b28
...
...
@@ -15,9 +15,9 @@ class Editor extends PureComponent {
constructor
()
{
super
(...
arguments
);
this
.
state
=
{
editorState
:
""
,
editorState
:
BraftEditor
.
createEditorState
(
''
),
// 初始化 editorState
defaultValue
:
""
,
readOnly
:
false
,
readOnly
:
false
,
};
}
componentDidMount
()
{
...
...
@@ -28,9 +28,8 @@ class Editor extends PureComponent {
})
}
if
(
importContent
)
{
console
.
log
(
importContent
,
type
,
'22222222222222222222'
)
this
.
setState
({
defaultValue
:
BraftEditor
.
createEditorState
(
importContent
),
editorState
:
BraftEditor
.
createEditorState
(
importContent
),
// 更新 editorState
});
}
...
...
@@ -64,7 +63,7 @@ class Editor extends PureComponent {
};
render
()
{
const
{
uploadParam
}
=
this
.
props
;
const
{
editorState
,
defaultValue
,
readOnly
}
=
this
.
state
;
const
{
editorState
,
defaultValue
,
readOnly
}
=
this
.
state
;
const
set
=
[
"undo"
,
"redo"
,
...
...
@@ -316,8 +315,7 @@ class Editor extends PureComponent {
forceNewLine
=
{
false
}
media
=
{{
uploadFn
:
myUploadFn
}}
className
=
{
styles
.
edit
}
// value={editorState} //动态赋值会造成光标位移
value
=
{
defaultValue
}
value
=
{
editorState
}
// 使用 editorState 作为 value
fontFamilies
=
{
fontFamilies
}
fontSizes
=
{
fontSizes
}
controls
=
{
set
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment