优化:移除重复逻辑和语法高亮支持
- 提取文件列表排序公共函数 sortFileList - 统一应用文件夹优先排序规则 - 移除生产环境 source map,减小打包体积 - 提升代码可维护性
This commit is contained in:
@@ -24,6 +24,7 @@
|
||||
<script setup lang="ts">
|
||||
import { ref, computed, onMounted } from 'vue'
|
||||
import { Message } from '@arco-design/web-vue'
|
||||
import { sortFileList } from '@/utils/fileUtils'
|
||||
|
||||
// 导入子组件
|
||||
import Toolbar from './components/Toolbar.vue'
|
||||
@@ -138,6 +139,7 @@ const loadDirectory = async (path: string) => {
|
||||
fileLoading.value = true
|
||||
try {
|
||||
fileList.value = await listDirectory(path)
|
||||
fileList.value = sortFileList(fileList.value)
|
||||
console.log('Files loaded:', fileList.value.length)
|
||||
} catch (error) {
|
||||
console.error('Load directory error:', error)
|
||||
|
||||
Reference in New Issue
Block a user