|
8 | 8 | popper-class="file-list" |
9 | 9 | > |
10 | 10 | <template #reference> |
11 | | - <el-button :icon="Folder" :disabled="disabled" @click="openPage()"></el-button> |
| 11 | + <el-button icon="Folder" :disabled="disabled" @click="openPage()"></el-button> |
12 | 12 | </template> |
13 | 13 | <div> |
14 | | - <el-button class="close" link @click="closePage"> |
15 | | - <el-icon><Close /></el-icon> |
16 | | - </el-button> |
17 | | - <BreadCrumbs> |
18 | | - <BreadCrumbItem @click="jump(-1)" :right="paths.length == 0"> |
19 | | - <el-icon><HomeFilled /></el-icon> |
20 | | - </BreadCrumbItem> |
21 | | - <template v-if="paths.length > 2"> |
22 | | - <BreadCrumbItem> |
23 | | - <el-dropdown ref="dropdown1" trigger="click" @command="jump($event)"> |
24 | | - <span class="el-dropdown-link">...</span> |
25 | | - <template #dropdown> |
26 | | - <el-dropdown-menu> |
27 | | - <el-dropdown-item |
28 | | - v-for="(item, key) in paths.slice(0, -1)" |
29 | | - :key="key" |
30 | | - :command="key" |
31 | | - > |
32 | | - {{ item }} |
33 | | - </el-dropdown-item> |
34 | | - </el-dropdown-menu> |
35 | | - </template> |
36 | | - </el-dropdown> |
37 | | - </BreadCrumbItem> |
38 | | - <BreadCrumbItem @click="jump(paths.length - 1)" :right="true"> |
39 | | - <span class="sle" style="max-width: 200px">{{ paths[paths.length - 1] }}</span> |
40 | | - </BreadCrumbItem> |
41 | | - </template> |
42 | | - <template v-else> |
43 | | - <BreadCrumbItem |
44 | | - v-for="(item, key) in paths" |
45 | | - :key="key" |
46 | | - @click="jump(key)" |
47 | | - :right="key == paths.length - 1" |
48 | | - > |
49 | | - <span class="sle" style="max-width: 200px">{{ item }}</span> |
50 | | - </BreadCrumbItem> |
51 | | - </template> |
52 | | - </BreadCrumbs> |
| 14 | + <el-button class="close" link @click="closePage" icon="Close"></el-button> |
| 15 | + <div> |
| 16 | + <el-button type="text" icon="HomeFilled" @click="jump(-1)"></el-button> |
| 17 | + <el-button v-if="paths.length > 0" type="text"> |
| 18 | + {{ paths[0] }} |
| 19 | + </el-button> |
| 20 | + <el-popover v-if="paths.length > 2" placement="bottom" trigger="hover"> |
| 21 | + <template #reference> |
| 22 | + <el-button type="text">...</el-button> |
| 23 | + </template> |
| 24 | + <div class="hidden-paths"> |
| 25 | + <el-button |
| 26 | + v-for="(path, index) in paths.slice(1, -1)" |
| 27 | + :key="index" |
| 28 | + type="text" |
| 29 | + @click="jump(index)" |
| 30 | + > |
| 31 | + {{ path }} |
| 32 | + </el-button> |
| 33 | + </div> |
| 34 | + </el-popover> |
| 35 | + <el-button v-if="paths.length > 1" type="text" @click="jump(paths.length - 1)"> |
| 36 | + {{ paths[paths.length - 1] }} |
| 37 | + </el-button> |
| 38 | + </div> |
53 | 39 | </div> |
54 | 40 | <div class="mt-4"> |
55 | 41 | <el-button link @click="onAddItem(true)" type="primary" size="small"> |
|
129 | 115 | <script lang="ts" setup> |
130 | 116 | import { File } from '@/api/interface/file'; |
131 | 117 | import { createFile, getFilesList } from '@/api/modules/files'; |
132 | | -import { Folder, HomeFilled, Close } from '@element-plus/icons-vue'; |
133 | | -import BreadCrumbs from '@/components/bread-crumbs/index.vue'; |
134 | | -import BreadCrumbItem from '@/components/bread-crumbs/bread-crumbs-item.vue'; |
135 | 118 | import { onMounted, onUpdated, reactive, ref, nextTick } from 'vue'; |
136 | 119 | import i18n from '@/lang'; |
137 | 120 | import { MsgSuccess, MsgWarning } from '@/utils/message'; |
@@ -362,4 +345,9 @@ onUpdated(() => { |
362 | 345 | float: right; |
363 | 346 | } |
364 | 347 | } |
| 348 | +
|
| 349 | +.hidden-paths { |
| 350 | + display: flex; |
| 351 | + flex-direction: column; |
| 352 | +} |
365 | 353 | </style> |
0 commit comments