Commit ee29f1ca by pangchong

refactor(editor): 优化条件渲染逻辑减少代码行数

- 将选中状态条件渲染的换行写法合并为单行表达式
- 精简类名绑定代码,提升代码可读性
- 保持功能逻辑不变,仅优化代码结构和格式
parent 0f82ec2b
......@@ -140,9 +140,7 @@
contenteditable="true"
class="focus:outline-none px-0.5 rounded inline transition-all whitespace-pre-wrap focus:bg-fill-3"
:class="[
editorStore.selectedNodeId === `${node.id}-txt-${index}`
? 'ring-2 ring-primary ring-offset-1 bg-primary/10'
: ''
editorStore.selectedNodeId === `${node.id}-txt-${index}` ? 'ring-2 ring-primary ring-offset-1 bg-primary/10' : ''
]"
@click.stop="editorStore.setSelectedNodeId(`${node.id}-txt-${index}`)"
@blur="handleMixedTextBlur(index, $event)"
......@@ -156,9 +154,7 @@
:contenteditable="false"
class="focus:outline-none px-0.5 rounded inline transition-all whitespace-pre-wrap"
:class="[
editorStore.selectedNodeId === `${node.id}-txt-${index}`
? 'ring-2 ring-primary ring-offset-1 bg-primary/10'
: ''
editorStore.selectedNodeId === `${node.id}-txt-${index}` ? 'ring-2 ring-primary ring-offset-1 bg-primary/10' : ''
]"
@click.stop="editorStore.setSelectedNodeId(`${node.id}-txt-${index}`)"
>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment