media_player_client/src/App.vue

55 lines
1.5 KiB
Vue
Raw Normal View History

2021-08-05 14:23:45 +08:00
<template>
2021-08-06 10:54:03 +08:00
<div class="fit">
<q-ajax-bar position="top" color="accent" size="5px" skip-hijack />
<router-view />
</div>
2021-08-05 14:23:45 +08:00
</template>
<script lang="ts">
2022-03-17 19:14:51 +08:00
import { SessionStorage, Cookies } from "quasar";
2021-08-05 17:26:27 +08:00
import { defineComponent } from "vue";
import { useI18n } from "vue-i18n";
2021-08-06 10:54:03 +08:00
import EventBus, { EventNamesDefine } from "src/common/EventBus";
import GlobalData from "./common/GlobalData";
import { useStore } from "src/store";
2021-08-05 14:23:45 +08:00
export default defineComponent({
2021-08-05 17:26:27 +08:00
name: "App",
2021-08-05 14:23:45 +08:00
setup() {
const $t = useI18n();
const $q = useStore();
2021-08-05 17:26:27 +08:00
document.title = $t.t("title");
window.onresize = (evt: any) =>
2021-08-06 10:54:03 +08:00
EventBus.getInstance().emit(EventNamesDefine.WindowResize, evt);
2021-08-09 15:05:14 +08:00
window.onmousedown = (evt: MouseEvent) => {
2022-01-25 11:34:07 +08:00
EventBus.getInstance().emit(EventNamesDefine.WindowMouseDown, evt);
};
window.onmousemove = (evt: any) => {
2022-01-25 11:34:07 +08:00
EventBus.getInstance().emit(EventNamesDefine.WindowMouseMove, evt);
};
window.onmouseup = (evt: any) => {
2022-01-25 11:34:07 +08:00
EventBus.getInstance().emit(EventNamesDefine.WindowMouseUp, evt);
};
window.onmouseout = (evt: any) => {
2022-01-25 11:34:07 +08:00
EventBus.getInstance().emit(EventNamesDefine.WindowMouseOut, evt);
};
2022-01-25 11:34:07 +08:00
window.document.body.onclick = (evt: any) => {
EventBus.getInstance().emit(EventNamesDefine.DocumentBodyClick, evt);
};
2021-08-09 15:05:14 +08:00
document.body.classList.add("overflow-hidden");
2022-03-17 19:14:51 +08:00
(window as any).controlLogout = () => {
Cookies.remove("auto_login");
SessionStorage.clear();
window.location.reload();
};
2021-08-05 14:23:45 +08:00
return {};
},
});
</script>