|
@@ -1,52 +1,63 @@
|
|
|
import "@/assets/theme.editor.scss";
|
|
|
import ClickOutSide from "@/utils/fns/ClickOutSide";
|
|
|
-import browser from '../utils/browser'
|
|
|
+import browser from "../utils/browser";
|
|
|
import Components from "@/global_components";
|
|
|
-import Delegate from '../utils/fns/Delegate'
|
|
|
-import { getApp } from '../app'
|
|
|
-import { createApp } from 'vue'
|
|
|
-import store from '../store'
|
|
|
-import Spg from './SPG.vue'
|
|
|
-import Checkbrowser from '../components/shared/Checkbrowser.vue'
|
|
|
-import i18n, { getLocale, setI18nLanguage, loadLocaleMessages } from '../i18n'
|
|
|
-import { IsApp } from '@/utils/platform'
|
|
|
-let App
|
|
|
-if (browser.detectChrome() || browser.detectSafari() || browser.detectFirefox() || browser.detectEdge() || browser.detectWeixin() || browser.detectWeixinMiniProgram() || browser.detectAlipay()
|
|
|
- || browser.detectTT()
|
|
|
+import Delegate from "../utils/fns/Delegate";
|
|
|
+import { getApp } from "../app";
|
|
|
+import { createApp } from "vue";
|
|
|
+import store from "../store";
|
|
|
+import Spg from "./SPG.vue";
|
|
|
+import Checkbrowser from "../components/shared/Checkbrowser.vue";
|
|
|
+import i18n, { getLocale, setI18nLanguage, loadLocaleMessages } from "../i18n";
|
|
|
+import { IsApp } from "@/utils/platform";
|
|
|
+let App;
|
|
|
+if (
|
|
|
+ browser.detectChrome() ||
|
|
|
+ browser.detectSafari() ||
|
|
|
+ browser.detectFirefox() ||
|
|
|
+ browser.detectEdge() ||
|
|
|
+ browser.detectWeixin() ||
|
|
|
+ browser.detectWeixinMiniProgram() ||
|
|
|
+ browser.detectAlipay() ||
|
|
|
+ browser.detectTT() ||
|
|
|
+ browser.detectTcTravel() ||
|
|
|
+ browser.detectDingDing()
|
|
|
) {
|
|
|
- App = Spg
|
|
|
+ App = Spg;
|
|
|
} else {
|
|
|
- if (IsApp) {
|
|
|
- App = SMG
|
|
|
- } else {
|
|
|
- App = Checkbrowser
|
|
|
- }
|
|
|
+ if (IsApp) {
|
|
|
+ App = SMG;
|
|
|
+ } else {
|
|
|
+ App = Checkbrowser;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
-const local = getLocale()
|
|
|
+const local = getLocale();
|
|
|
loadLocaleMessages(i18n, local).then(() => {
|
|
|
- setI18nLanguage(i18n, local)
|
|
|
+ setI18nLanguage(i18n, local);
|
|
|
|
|
|
- const app = (window.__app = createApp(App))
|
|
|
- app.use(i18n)
|
|
|
- app.use(store)
|
|
|
- app.use(Components)
|
|
|
- app.directive('click-outside', ClickOutSide)
|
|
|
- app.mount('#app')
|
|
|
- const handleUserInputFocus = () => {
|
|
|
- setTimeout(() => {
|
|
|
- getApp().config.useShortcutKeys = false
|
|
|
- }, 200)
|
|
|
- }
|
|
|
+ const app = (window.__app = createApp(App));
|
|
|
+ app.use(i18n);
|
|
|
+ app.use(store);
|
|
|
+ app.use(Components);
|
|
|
+ app.directive("click-outside", ClickOutSide);
|
|
|
+ app.mount("#app");
|
|
|
+ const handleUserInputFocus = () => {
|
|
|
+ setTimeout(() => {
|
|
|
+ getApp().config.useShortcutKeys = false;
|
|
|
+ }, 200);
|
|
|
+ };
|
|
|
|
|
|
- const handleUserInputBlur = () => {
|
|
|
- setTimeout(() => {
|
|
|
- getApp().config.useShortcutKeys = true
|
|
|
- }, 200)
|
|
|
- }
|
|
|
+ const handleUserInputBlur = () => {
|
|
|
+ setTimeout(() => {
|
|
|
+ getApp().config.useShortcutKeys = true;
|
|
|
+ }, 200);
|
|
|
+ };
|
|
|
|
|
|
- Delegate(document, 'focus', 'input', () => handleUserInputFocus())
|
|
|
- Delegate(document, 'focus', '[contenteditable]', () => handleUserInputFocus())
|
|
|
- Delegate(document, 'blur', 'input', () => handleUserInputBlur())
|
|
|
- Delegate(document, 'blur', '[contenteditable]', () => handleUserInputBlur())
|
|
|
-})
|
|
|
+ Delegate(document, "focus", "input", () => handleUserInputFocus());
|
|
|
+ Delegate(document, "focus", "[contenteditable]", () =>
|
|
|
+ handleUserInputFocus()
|
|
|
+ );
|
|
|
+ Delegate(document, "blur", "input", () => handleUserInputBlur());
|
|
|
+ Delegate(document, "blur", "[contenteditable]", () => handleUserInputBlur());
|
|
|
+});
|