feat: 优化插件导入逻辑,视频插件在移动端进入锁定状态时隐藏上下梯度渐变以防止遮挡视频
This commit is contained in:
1 parent
bfc841fac2
commit
8f8d098faa
4 files changed
+11
-10
No files matched your search
@@ -176,7 +176,7 @@ export class VirtualPages {
|
||||
find(name: string) : VirtualPage[]
|
||||
|
||||
find(input: unknown) {
|
||||
console.log(this)
|
||||
// console.log(this)
|
||||
if (typeof input === 'string') {
|
||||
return this._views.filter(v => v.component.name === input);
|
||||
} else {
|
||||
|
||||
@@ -4,24 +4,22 @@ import { alertTipType, PluginExportType } from "@/types/type";
|
||||
|
||||
const initPlugin = async (globalAlertTip: alertTipType) => {
|
||||
initPluginCenter(globalAlertTip);
|
||||
const modulesFiles = import.meta.glob("@/plugins/**/export.ts");
|
||||
const modulesFiles = import.meta.glob("@/plugins/**/export.ts", { eager: true });
|
||||
const pluginCenter = usePluginCenter();
|
||||
const promiseArray = [];
|
||||
for (let pluginConfig of Object.values(modulesFiles)) {
|
||||
promiseArray.push(
|
||||
new Promise(async resolve => {
|
||||
const _config = pluginConfig as () => Promise<{
|
||||
const _config = pluginConfig as {
|
||||
default: registerComponentOption | Plugin;
|
||||
type: PluginExportType;
|
||||
key?: string;
|
||||
}>;
|
||||
const { type, key } = await _config();
|
||||
};
|
||||
const { type, key } = _config;
|
||||
if (type === PluginExportType.component) {
|
||||
// @ts-ignore
|
||||
resolve(pluginCenter.registerComponent((await _config()).default));
|
||||
resolve(pluginCenter.registerComponent(_config.default as registerComponentOption));
|
||||
} else if (type === PluginExportType.default) {
|
||||
// @ts-ignore
|
||||
resolve(pluginCenter.register(key as string, (await _config()).default));
|
||||
resolve(pluginCenter.register(key as string, _config.default as Plugin));
|
||||
}
|
||||
})
|
||||
);
|
||||
|
||||
@@ -15,7 +15,7 @@ const pluginConfig: registerComponentOption = {
|
||||
return false
|
||||
}
|
||||
for (let i of vFiles) {
|
||||
for (let s of ['mp4']) {
|
||||
for (let s of ['mp4', 'mkv']) {
|
||||
if (i.name.endsWith(s)) {
|
||||
return true
|
||||
}
|
||||
|
||||
@@ -1194,6 +1194,9 @@
|
||||
.xgplayer-mobile.xgplayer-inactive .gradient {
|
||||
background-image: initial;
|
||||
}
|
||||
.xgplayer-locked .gradient {
|
||||
background-image: initial;
|
||||
}
|
||||
.xgplayer-mobile .xgmask {
|
||||
position: absolute;
|
||||
height: 100%;
|
||||
|
||||
Reference in new issue
Block a user