Skip to content

Commit 40ca30d

Browse files
committed
fix (core): 修复 Windows 环境下获取元素 null
1 parent 039916f commit 40ca30d

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

src/App.vue

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,9 @@
1616
<div class="flex-1 flex flex-col overflow-hidden">
1717
<div class="bg-gray-100 px-4 py-2 border-b border-gray-200 flex items-center justify-between flex-shrink-0">
1818
<h2 class="text-sm font-medium text-gray-700">{{ getLanguageDisplayName(currentLanguage) }} 代码编辑器</h2>
19-
<div class="text-xs text-gray-500">
20-
<strong>{{ code.length }}</strong> 字符, <strong>{{ code.split('\n').length }}</strong> 行
19+
<div class="flex items-center space-x-2 text-xs text-gray-500">
20+
<span><strong>{{ (code || '').length }}</strong> 字符</span>
21+
<span><strong>{{ (code || '').split('\n').length }}</strong> 行</span>
2122
</div>
2223
</div>
2324
<div class="flex-1 overflow-hidden">
@@ -38,7 +39,7 @@
3839
</div>
3940

4041
<!-- 状态栏 -->
41-
<StatusBar :env-info="envInfo" :execution-time="lastExecutionTime" :code-length="code.length"/>
42+
<StatusBar :env-info="envInfo" :execution-time="lastExecutionTime" :code-length="(code || '').length"/>
4243

4344
<!-- 关于组件 -->
4445
<About v-if="showAbout" @close="closeAbout"/>

0 commit comments

Comments
 (0)