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
ee29f1ca
Commit
ee29f1ca
authored
Jul 07, 2026
by
pangchong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor(editor): 优化条件渲染逻辑减少代码行数
- 将选中状态条件渲染的换行写法合并为单行表达式 - 精简类名绑定代码,提升代码可读性 - 保持功能逻辑不变,仅优化代码结构和格式
parent
0f82ec2b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
6 deletions
+2
-6
src/views/editor/components/DocNodeRenderer/index.vue
+2
-6
No files found.
src/views/editor/components/DocNodeRenderer/index.vue
View file @
ee29f1ca
...
@@ -140,9 +140,7 @@
...
@@ -140,9 +140,7 @@
contenteditable="true"
contenteditable="true"
class="focus:outline-none px-0.5 rounded inline transition-all whitespace-pre-wrap focus:bg-fill-3"
class="focus:outline-none px-0.5 rounded inline transition-all whitespace-pre-wrap focus:bg-fill-3"
:class="[
:class="[
editorStore.selectedNodeId === `${node.id}-txt-${index}`
editorStore.selectedNodeId === `${node.id}-txt-${index}` ? 'ring-2 ring-primary ring-offset-1 bg-primary/10' : ''
? 'ring-2 ring-primary ring-offset-1 bg-primary/10'
: ''
]"
]"
@click.stop="editorStore.setSelectedNodeId(`${node.id}-txt-${index}`)"
@click.stop="editorStore.setSelectedNodeId(`${node.id}-txt-${index}`)"
@blur="handleMixedTextBlur(index, $event)"
@blur="handleMixedTextBlur(index, $event)"
...
@@ -156,9 +154,7 @@
...
@@ -156,9 +154,7 @@
:contenteditable="false"
:contenteditable="false"
class="focus:outline-none px-0.5 rounded inline transition-all whitespace-pre-wrap"
class="focus:outline-none px-0.5 rounded inline transition-all whitespace-pre-wrap"
:class="[
:class="[
editorStore.selectedNodeId === `${node.id}-txt-${index}`
editorStore.selectedNodeId === `${node.id}-txt-${index}` ? 'ring-2 ring-primary ring-offset-1 bg-primary/10' : ''
? 'ring-2 ring-primary ring-offset-1 bg-primary/10'
: ''
]"
]"
@click.stop="editorStore.setSelectedNodeId(`${node.id}-txt-${index}`)"
@click.stop="editorStore.setSelectedNodeId(`${node.id}-txt-${index}`)"
>
>
...
...
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