更新
This commit is contained in:
parent
2a43fa33ab
commit
ed066f8565
@ -16,7 +16,7 @@ let vuePath = node_env === 'production' ?
|
|||||||
'vue/dist/vue.runtime.esm-browser.prod.js' :
|
'vue/dist/vue.runtime.esm-browser.prod.js' :
|
||||||
'vue/dist/vue.runtime.esm-browser.js';
|
'vue/dist/vue.runtime.esm-browser.js';
|
||||||
export default {
|
export default {
|
||||||
input: 'src/ts/class/Application.ts',
|
input: 'src/ts/index.ts',
|
||||||
output: {
|
output: {
|
||||||
file: 'dist/bundle.js',
|
file: 'dist/bundle.js',
|
||||||
format: 'iife',
|
format: 'iife',
|
||||||
|
|||||||
@ -1,47 +1,48 @@
|
|||||||
import WuhuBase from "./WuhuBase";
|
// import WuhuBase from "./WuhuBase";
|
||||||
import WuHuTornHelper from "./WuhuTornHelper";
|
// import WuHuTornHelper from "./WuhuTornHelper";
|
||||||
import ZhongIcon from "./ZhongIcon";
|
// import ZhongIcon from "./ZhongIcon";
|
||||||
import { Common } from "./Common";
|
// import { Common } from "./Common";
|
||||||
import UrlPattern from "./UrlMatch";
|
// import UrlPattern from "./UrlMatch";
|
||||||
import WuhuConfig from "./WuhuConfig";
|
// import WuhuConfig from "./WuhuConfig";
|
||||||
import translateMain from "../func/translate/translateMain";
|
// import translateMain from "../func/translate/translateMain";
|
||||||
import CommonUtils from "./utils/CommonUtils";
|
// import CommonUtils from "./utils/CommonUtils";
|
||||||
import EntryPoint from "./provider/EntryPoint";
|
// import EntryPoint from "./provider/EntryPoint";
|
||||||
|
//
|
||||||
@EntryPoint
|
// @EntryPoint
|
||||||
export default class Application {
|
// export default class Application {
|
||||||
|
//
|
||||||
public static main(): void {
|
// public static main(): void {
|
||||||
WuhuBase.conditionInterrupt();
|
// WuhuBase.conditionInterrupt();
|
||||||
|
//
|
||||||
// 初始化
|
// // 初始化
|
||||||
WuHuTornHelper.getInstance().init();
|
// WuHuTornHelper.getInstance().init();
|
||||||
|
//
|
||||||
// 插件设置默认值
|
// // 插件设置默认值
|
||||||
WuhuConfig.setDefaults();
|
// WuhuConfig.setDefaults();
|
||||||
|
//
|
||||||
// 插件图标和设置菜单
|
// // 插件图标和设置菜单
|
||||||
ZhongIcon.getInstance().init();
|
// ZhongIcon.getInstance().init();
|
||||||
|
//
|
||||||
let tmp = () => {
|
// let tmp = () => {
|
||||||
// 所有页面通用
|
// // 所有页面通用
|
||||||
try {
|
// try {
|
||||||
Common.getInstance().resolve(Application.main);
|
// Common.getInstance().resolve(Application.main);
|
||||||
} catch (e) {
|
// } catch (e) {
|
||||||
// if (e.message === '重载') Common.getInstance().resolve(null);
|
// // if (e.message === '重载') Common.getInstance().resolve(null);
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
// URL匹配
|
// // URL匹配
|
||||||
UrlPattern.getInstance().resolve();
|
// UrlPattern.getInstance().resolve();
|
||||||
|
//
|
||||||
// 翻译
|
// // 翻译
|
||||||
if (WuhuConfig.get('transEnable')) translateMain(window.location.href);
|
// if (WuhuConfig.get('transEnable')) translateMain(window.location.href);
|
||||||
};
|
// };
|
||||||
// TODO 临时检测jquery
|
// // TODO 临时检测jquery
|
||||||
if (typeof $ === "function") {
|
// if (typeof $ === "function") {
|
||||||
tmp();
|
// tmp();
|
||||||
} else {
|
// } else {
|
||||||
CommonUtils.getInstance().jQueryReady().then(() => tmp());
|
// CommonUtils.getInstance().jQueryReady().then(() => tmp());
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
export default {}
|
||||||
@ -1,4 +1,47 @@
|
|||||||
// import Starter from "./class/provider/Starter";
|
import WuhuBase from "./class/WuhuBase";
|
||||||
// import Application from "./class/Application";
|
import WuHuTornHelper from "./class/WuhuTornHelper";
|
||||||
//
|
import ZhongIcon from "./class/ZhongIcon";
|
||||||
// Starter.run(Application);
|
import { Common } from "./class/Common";
|
||||||
|
import UrlPattern from "./class/UrlMatch";
|
||||||
|
import WuhuConfig from "./class/WuhuConfig";
|
||||||
|
import translateMain from "./func/translate/translateMain";
|
||||||
|
import CommonUtils from "./class/utils/CommonUtils";
|
||||||
|
import EntryPoint from "./class/provider/EntryPoint";
|
||||||
|
|
||||||
|
@EntryPoint
|
||||||
|
export default class Application {
|
||||||
|
|
||||||
|
public static main(): void {
|
||||||
|
WuhuBase.conditionInterrupt();
|
||||||
|
|
||||||
|
// 初始化
|
||||||
|
WuHuTornHelper.getInstance().init();
|
||||||
|
|
||||||
|
// 插件设置默认值
|
||||||
|
WuhuConfig.setDefaults();
|
||||||
|
|
||||||
|
// 插件图标和设置菜单
|
||||||
|
ZhongIcon.getInstance().init();
|
||||||
|
|
||||||
|
let tmp = () => {
|
||||||
|
// 所有页面通用
|
||||||
|
try {
|
||||||
|
Common.getInstance().resolve(Application.main);
|
||||||
|
} catch (e) {
|
||||||
|
// if (e.message === '重载') Common.getInstance().resolve(null);
|
||||||
|
}
|
||||||
|
|
||||||
|
// URL匹配
|
||||||
|
UrlPattern.getInstance().resolve();
|
||||||
|
|
||||||
|
// 翻译
|
||||||
|
if (WuhuConfig.get('transEnable')) translateMain(window.location.href);
|
||||||
|
};
|
||||||
|
// TODO 临时检测jquery
|
||||||
|
if (typeof $ === "function") {
|
||||||
|
tmp();
|
||||||
|
} else {
|
||||||
|
CommonUtils.getInstance().jQueryReady().then(() => tmp());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user