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
1891c0bc
Commit
1891c0bc
authored
Apr 02, 2025
by
pangchong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 对比优化
parent
069fecb9
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
3 deletions
+4
-3
src/configs/render-elem.ts
+0
-1
src/views/editor/functions/compare.ts
+4
-2
No files found.
src/configs/render-elem.ts
View file @
1891c0bc
...
...
@@ -2,7 +2,6 @@ import { h, VNode } from 'snabbdom'
import
{
IDomEditor
,
IModuleConf
,
SlateElement
}
from
'@wangeditor/editor'
import
{
nodeSet
}
from
'@/configs/node.config'
import
{
handleMouseEnter
,
handleMouseLeave
}
from
'@/views/editor/functions/compare'
import
{
debounce
}
from
'lodash'
const
renderElem
=
(
type
:
string
,
style
=
{
display
:
'block'
})
=>
{
return
(
elem
:
SlateElement
,
children
:
VNode
[]
|
null
,
editor
:
IDomEditor
):
VNode
=>
{
...
...
src/views/editor/functions/compare.ts
View file @
1891c0bc
import
{
NewTreeModification
,
OldTreeModification
,
TreeRenderResult
}
from
'@/lib/XMLProcessor/src/typing'
import
{
compareContainerRef
,
compareLeftRef
,
compareRightRef
}
from
'../constants/compare'
import
{
compareContainerRef
,
compareLeftRef
,
compareRightRef
,
showCompare
}
from
'../constants/compare'
import
{
debounce
}
from
'lodash'
export
const
handleMouseEnter
=
debounce
((
event
:
any
)
=>
{
if
(
!
showCompare
.
value
)
return
const
width
=
compareContainerRef
.
value
?.
clientWidth
const
x
=
event
.
clientX
const
y
=
event
.
clientY
...
...
@@ -10,8 +11,9 @@ export const handleMouseEnter = debounce((event: any) => {
const
element2
=
document
.
elementFromPoint
(
width
-
x
,
y
)
element1
?.
classList
.
add
(
'bg-progressRailColor'
)
element2
?.
classList
.
add
(
'bg-progressRailColor'
)
},
2
0
0
)
},
2
5
0
)
export
const
handleMouseLeave
=
()
=>
{
if
(
!
showCompare
.
value
)
return
const
elements
=
document
.
querySelectorAll
(
'.bg-progressRailColor'
)
elements
.
forEach
((
element
)
=>
{
element
.
classList
.
remove
(
'bg-progressRailColor'
)
...
...
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