/
githubmirror
/
photoprism
Обзор
Документация
Войти
/
githubmirror
/
photoprism
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
develop
frontend/src/app.vue
69 строк
2 KB
Michael Mayer
Lightbox: Use this.subscriptions as array #5258
12 окт 2025, 16:45
12 окт 2025, 16:45
2b10245
Код
Авторство
О чём код?
<template> <div id="photoprism" :class="['theme-' + themeName]"> <p-loading-bar height="4"></p-loading-bar> <v-app :class="appClass"> <p-navigation></p-navigation> <v-main> <router-view></router-view> </v-main> </v-app> <p-dialogs></p-dialogs> <p-notify></p-notify> </div> </template> <script> import PLoadingBar from "component/loading-bar.vue"; import PNotify from "component/notify.vue"; import PNavigation from "component/navigation.vue"; import PDialogs from "component/dialogs.vue"; export default { name: "App", components: { PLoadingBar, PNotify, PNavigation, PDialogs, }, data() { return { themeName: this.$config.themeName, subscriptions: [], touchStart: 0, }; }, computed: { appClass: function () { return [ this.$route.meta.background, this.$vuetify.display.smAndDown ? "small-screen" : "large-screen", this.$route.meta.hideNav ? "hide-nav" : "show-nav", ]; }, }, created() { this.subscriptions.push(this.$event.subscribe("view.refresh", (ev, data) => this.onRefresh(data))); this.$config.setVuetify(this.$vuetify); }, mounted() { this.$view.enter(this); }, beforeUnmount() { for (let i = 0; i < this.subscriptions.length; i++) { this.$event.unsubscribe(this.subscriptions[i]); } }, unmounted() { this.$view.leave(this); }, methods: { onRefresh(config) { this.themeName = config.themeName; }, }, }; </script>