feat: 1.新增视频播放插件。2.新增插件中心
This commit is contained in:
1 parent
f5e0bd4a56
commit
1f6c924e11
13 files changed
+2465
-44
No files matched your search
@@ -0,0 +1,22 @@
|
||||
import MiaoDirectory from "@/views/miaoDirectory.vue";
|
||||
import usePluginCenter from "./usePluginCenter";
|
||||
import MiaoVideoPlayer from "@/views/miaoVideoPlayer.vue";
|
||||
|
||||
export default function init() {
|
||||
const pluginCenter = usePluginCenter();
|
||||
pluginCenter.registerComponent("miaoDirectory", "文件夹", MiaoDirectory, (vDirs, vFiles) => {
|
||||
if (vFiles.length) {
|
||||
return false;
|
||||
}
|
||||
return vDirs.length === 1;
|
||||
});
|
||||
pluginCenter.registerComponent("miaoVideoPlayer", "视频", MiaoVideoPlayer, (vDirs, vFiles) => {
|
||||
if (vDirs.length !== 0) {
|
||||
return false;
|
||||
}
|
||||
if (vFiles.length === 0) {
|
||||
return false;
|
||||
}
|
||||
return vFiles.length === 1 && vFiles[0].name.endsWith("mp4");
|
||||
});
|
||||
}
|
||||
Reference in new issue
Block a user