Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
V
vue3_onlineEditor
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
pangchong
vue3_onlineEditor
Commits
bdf9aa2b
Commit
bdf9aa2b
authored
Mar 28, 2025
by
pangchong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 富文本数据修改
parent
fc3298df
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
2 additions
and
5 deletions
+2
-5
src/views/editor/functions/elem-to-html.ts
+0
-2
src/views/editor/functions/index.ts
+1
-2
src/views/editor/functions/render-elem.ts
+1
-1
No files found.
src/views/editor/functions/elem-to-html.ts
View file @
bdf9aa2b
...
...
@@ -5,8 +5,6 @@ const elemToHtml = (type: string) => {
const
dataKey
=
(
elem
as
any
).
dataKey
||
''
return
`<
${
type
}
data-w-e-type="
${
type
}
"
data-w-e-is-void
data-w-e-is-inline
data-key="
${
dataKey
}
"
>
${
childrenHtml
}
</
${
type
}
>`
}
...
...
src/views/editor/functions/index.ts
View file @
bdf9aa2b
...
...
@@ -20,8 +20,7 @@ export const handleEditor = (editor: IDomEditor) => {
export
const
nodeProps
=
({
option
}:
{
option
:
TreeOption
})
=>
{
return
{
onClick
()
{
console
.
log
(
editorRef
.
value
?.
editorRef
.
getEditableContainer
())
editorRef
.
value
?.
editorRef
.
scrollToElem
([
'w-e-element-124'
])
editorRef
.
value
?.
editorRef
.
scrollToElem
([
option
.
key
])
}
}
}
src/views/editor/functions/render-elem.ts
View file @
bdf9aa2b
...
...
@@ -4,7 +4,7 @@ import { IDomEditor, IModuleConf, SlateElement } from '@wangeditor/editor'
const
renderElem
=
(
type
:
string
,
style
=
{
display
:
'block'
})
=>
{
return
(
elem
:
SlateElement
,
children
:
VNode
[]
|
null
,
editor
:
IDomEditor
):
VNode
=>
{
const
dataKey
=
(
elem
as
any
).
dataKey
return
h
(
type
,
{
style
,
props
:
{
id
:
dataKey
}
},
children
)
return
h
(
type
,
{
style
,
attrs
:
{
dataKey
:
dataKey
}
},
children
)
}
}
const
createRenderConfig
=
(
types
:
string
|
string
[])
=>
{
...
...
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