Skip to content

Commit f4ab0ae

Browse files
committed
✨ 抽取右键菜单为单独组件
1 parent de57481 commit f4ab0ae

File tree

1 file changed

+2
-34
lines changed

1 file changed

+2
-34
lines changed

src/pages/file.vue

Lines changed: 2 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -242,11 +242,10 @@ import useGlobalConfigStore from "~/stores/global-config";
242242
// element table 表格加载动画
243243
import "~/assets/table-animation.less";
244244
// element 图标
245-
import { Calendar, Coin, Document, FolderOpened } from "@element-plus/icons-vue";
245+
import { Calendar, Coin, Document } from "@element-plus/icons-vue";
246246
247-
// 右键菜单
248-
import { Contextmenu, ContextmenuDivider, ContextmenuItem } from "v-contextmenu";
249247
import useFileContextMenu from "~/composables/file/useFileContextMenu";
248+
const { showFileMenu } = useFileContextMenu();
250249
251250
// 文件类别数据相关
252251
import useFileData from "~/composables/file/useFileData";
@@ -329,7 +328,6 @@ let storageConfigStore = useStorageConfigStore();
329328
let globalConfigStore = useGlobalConfigStore();
330329
331330
const currentInstance = getCurrentInstance();
332-
const { showFileMenu, contextMenuTargetFile } = useFileContextMenu(currentInstance);
333331
334332
let { checkSelectable, selectRowsChange, selectRow, selectRows, selectStatistics, tableRowClassName, clearSelection } = useFileSelect(currentInstance);
335333
@@ -622,36 +620,6 @@ const showDialog = (readmeText) => {
622620
623621
}
624622
625-
// 右键菜单
626-
.v-contextmenu-item {
627-
// 文字和图标的距离
628-
:deep(label) {
629-
@apply ml-2.5;
630-
}
631-
632-
// 图标位置修正为居中
633-
:deep(.contextmenu-icon) {
634-
@apply top-[1px] pt-[1px];
635-
}
636-
}
637-
638-
.zfile-index-body {
639-
// 工具条
640-
.zfile-index-hover-tools {
641-
@apply absolute z-10 bottom-0 sm:bottom-10 left-0 right-0 mx-auto w-fit;
642-
643-
.zfile-index-hover-body {
644-
@apply bg-[#313136] w-fit px-5 h-12 py-2 text-white rounded mx-auto space-x-6 text-2xl;
645-
646-
svg {
647-
@apply inline text-white cursor-pointer outline-none;
648-
&:hover {
649-
@apply text-blue-400;
650-
}
651-
}
652-
}
653-
}
654-
}
655623
</style>
656624

657625
<route lang="yaml">

0 commit comments

Comments
 (0)