Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
I
Ifar-Xml-Edtor
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
Ifar-Xml-Edtor
Commits
1bb9b364
Commit
1bb9b364
authored
Jul 28, 2026
by
pangchong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 格式化代码
parent
5af0d0fb
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
10 deletions
+32
-10
src/views/editor/components/EditorToolbar/components/CompareModal/functionals/index.ts
+12
-4
src/views/editor/components/TableEditor/index.vue
+20
-6
No files found.
src/views/editor/components/EditorToolbar/components/CompareModal/functionals/index.ts
View file @
1bb9b364
...
...
@@ -941,13 +941,19 @@ export function useCompareModal() {
// 2. 临时关闭 transition(避免 paddingBottom 动画导致 offsetHeight 读到中间值)
const
allNodes
=
[...
leftAll
,
...
rightAll
]
allNodes
.
forEach
((
el
)
=>
{
el
.
style
.
transition
=
'none'
})
allNodes
.
forEach
((
el
)
=>
{
el
.
style
.
transition
=
'none'
})
// 强制 reflow,使 transition:none 立即生效
void
lc
.
offsetHeight
// 3. 清除所有旧的 paddingBottom
leftAll
.
forEach
((
el
)
=>
{
el
.
style
.
paddingBottom
=
''
})
rightAll
.
forEach
((
el
)
=>
{
el
.
style
.
paddingBottom
=
''
})
leftAll
.
forEach
((
el
)
=>
{
el
.
style
.
paddingBottom
=
''
})
rightAll
.
forEach
((
el
)
=>
{
el
.
style
.
paddingBottom
=
''
})
// 再次强制 reflow,确保清除立即生效
void
lc
.
offsetHeight
...
...
@@ -980,7 +986,9 @@ export function useCompareModal() {
// 5. 补偿完成后在下一帧恢复 transition
requestAnimationFrame
(()
=>
{
allNodes
.
forEach
((
el
)
=>
{
el
.
style
.
transition
=
''
})
allNodes
.
forEach
((
el
)
=>
{
el
.
style
.
transition
=
''
})
})
}
...
...
src/views/editor/components/TableEditor/index.vue
View file @
1bb9b364
...
...
@@ -94,11 +94,16 @@
@
contextmenu
.
prevent=
"isDiffMode ? null : handleCellContextMenu(cell, row.id, $event)"
>
<!-- 属性变更徽标:absolute 定位在单元格右上角,不侵入内容流 -->
<n-popover
v-if=
"cell.rawNode?.attrDiffs && cell.rawNode.attrDiffs.length > 0"
trigger=
"hover"
placement=
"top-end"
style=
"max-width: 380px"
>
<n-popover
v-if=
"cell.rawNode?.attrDiffs && cell.rawNode.attrDiffs.length > 0"
trigger=
"hover"
placement=
"top-end"
style=
"max-width: 380px"
>
<template
#
trigger
>
<span
class=
"attr-diff-badge absolute -top-2 right-0 inline-flex items-center gap-0.5 px-1.5 py-0.5 rounded text-[10px] font-bold font-mono cursor-pointer select-none shadow-md z-20 pointer-events-auto transition-all hover:opacity-90"
style=
"background: #f59e0b; color: #fff; line-height: 1.2
;
"
style=
"background: #f59e0b; color: #fff; line-height: 1.2"
@
click
.
stop
>
🏷️
{{
cell
.
rawNode
.
tagName
}}
...
...
@@ -112,7 +117,9 @@
<span
class=
"font-semibold"
>
{{ diff.key }}:
</span>
<span
class=
"line-through text-red-500 px-1 bg-red-500/10 rounded"
>
{{ diff.oldVal || '(空)' }}
</span>
<span
class=
"text-amber-500 font-bold"
>
➔
</span>
<span
class=
"text-emerald-600 dark:text-emerald-400 font-bold px-1 bg-emerald-500/10 rounded"
>
{{ diff.newVal || '(空)' }}
</span>
<span
class=
"text-emerald-600 dark:text-emerald-400 font-bold px-1 bg-emerald-500/10 rounded"
>
{{ diff.newVal || '(空)' }}
</span>
</div>
</div>
</n-popover>
...
...
@@ -231,11 +238,16 @@
@
contextmenu
.
prevent=
"isDiffMode ? null : handleCellContextMenu(cell, row.id, $event)"
>
<!-- 属性变更徽标:absolute 定位在单元格右上角,不侵入内容流 -->
<n-popover
v-if=
"cell.rawNode?.attrDiffs && cell.rawNode.attrDiffs.length > 0"
trigger=
"hover"
placement=
"top-end"
style=
"max-width: 380px"
>
<n-popover
v-if=
"cell.rawNode?.attrDiffs && cell.rawNode.attrDiffs.length > 0"
trigger=
"hover"
placement=
"top-end"
style=
"max-width: 380px"
>
<template
#
trigger
>
<span
class=
"attr-diff-badge absolute -top-2 right-0 inline-flex items-center gap-0.5 px-1.5 py-0.5 rounded text-[10px] font-bold font-mono cursor-pointer select-none shadow-md z-20 pointer-events-auto transition-all hover:opacity-90"
style=
"background: #f59e0b; color: #fff; line-height: 1.2
;
"
style=
"background: #f59e0b; color: #fff; line-height: 1.2"
@
click
.
stop
>
🏷️
{{
cell
.
rawNode
.
tagName
}}
...
...
@@ -249,7 +261,9 @@
<span
class=
"font-semibold"
>
{{ diff.key }}:
</span>
<span
class=
"line-through text-red-500 px-1 bg-red-500/10 rounded"
>
{{ diff.oldVal || '(空)' }}
</span>
<span
class=
"text-amber-500 font-bold"
>
➔
</span>
<span
class=
"text-emerald-600 dark:text-emerald-400 font-bold px-1 bg-emerald-500/10 rounded"
>
{{ diff.newVal || '(空)' }}
</span>
<span
class=
"text-emerald-600 dark:text-emerald-400 font-bold px-1 bg-emerald-500/10 rounded"
>
{{ diff.newVal || '(空)' }}
</span>
</div>
</div>
</n-popover>
...
...
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