feat: 添加主页插件支持

This commit is contained in:
539943419 committed 2024-09-30 23:21:05 +08:00
1 parent 1f42785b4a
commit 90a068939d
11 files changed
+184 -82

No files matched your search

+32 -31
View File
@@ -1,35 +1,36 @@
import { registerComponentOption } from '@/class/PluginCenter'
import { PluginExportType } from '@/types/type'
import Disc from '@vicons/ionicons5/es/Disc'
import { registerComponentOption } from "@/class/PluginCenter";
import { PluginExportType } from "@/types/type";
import Disc from "@vicons/ionicons5/es/Disc";
const pluginConfig: registerComponentOption = {
key: 'miaoMusicPlayer',
name: '音乐',
icon: Disc,
getComponent: async () =>
(await import('./miaoMusicPlayer.vue')).default,
filter: (vDirs, vFiles) => {
if (vDirs.length !== 0) {
return false
}
if (vFiles.length === 0) {
return false
}
for (let i of vFiles) {
for (let s of ['mp3', 'flac', 'ogg', 'mp4']) {
if (i.name.endsWith(s)) {
return true
}
}
}
return false
},
disable: false,
single: true,
priority: 5,
}
key: "miaoMusicPlayer",
name: "音乐",
icon: Disc,
getComponent: async () => (await import("./miaoMusicPlayer.vue")).default,
filter: (vDirs, vFiles) => {
if (vDirs.length === 0 && vFiles.length === 0) {
return true;
}
if (vDirs.length !== 0) {
return false;
}
if (vFiles.length === 0) {
return false;
}
for (let i of vFiles) {
for (let s of ["mp3", "flac", "ogg", "mp4"]) {
if (i.name.endsWith(s)) {
return true;
}
}
}
return false;
},
disable: false,
single: true,
priority: 5
};
export default pluginConfig
export default pluginConfig;
export const type = PluginExportType.component
export const type = PluginExportType.component;