полный рефакторинг всей системы
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
70
src/App.vue
70
src/App.vue
@@ -1,66 +1,28 @@
|
||||
<script setup>
|
||||
import { onMounted, ref, watch } from "vue";
|
||||
import All_new_section from "./components/Naw_bar/All_new_section.vue";
|
||||
import General_section from "./components/News_section/General_section.vue";
|
||||
import Setings from "./components/Settings_section/Setings.vue";
|
||||
import Authe from "./components/Autherization/Authe.vue";
|
||||
import Istochnik from "./components/Istochnik_section/Istochnik.vue";
|
||||
import { ref } from 'vue'
|
||||
import NavBar from './components/Naw_bar/All_new_section.vue'
|
||||
import NewsFeed from './components/News_section/General_section.vue'
|
||||
import Settings from './components/Settings_section/Settings.vue'
|
||||
import Auth from './components/Autherization/Authe.vue'
|
||||
import Sources from './components/Istochnik_section/Istochnik.vue'
|
||||
|
||||
// Инициализация темы при загрузке приложения
|
||||
onMounted(() => {
|
||||
const savedTheme = localStorage.getItem("theme");
|
||||
if (savedTheme === "dark") {
|
||||
document.documentElement.classList.add("dark");
|
||||
} else if (savedTheme === "light") {
|
||||
document.documentElement.classList.remove("dark");
|
||||
} else {
|
||||
// Проверяем системные настройки
|
||||
if (window.matchMedia("(prefers-color-scheme: dark)").matches) {
|
||||
document.documentElement.classList.add("dark");
|
||||
}
|
||||
}
|
||||
});
|
||||
const currentPage = ref('admin-panel')
|
||||
|
||||
// Состояния страницы и данные для входа
|
||||
const currentPage = ref("admin-panel");
|
||||
|
||||
function handleUpdate(newValue) {
|
||||
currentPage.value = newValue; // изменение значения в родителе
|
||||
function navigateTo(page) {
|
||||
currentPage.value = page
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
<template>
|
||||
<Authe :currentPage="currentPage" @update="handleUpdate" />
|
||||
<div v-if="currentPage === 'rezylt'">
|
||||
<div class="sm:flex">
|
||||
<All_new_section :currentPage="currentPage" @update="handleUpdate" />
|
||||
<General_section filter="all" />
|
||||
</div>
|
||||
</div>
|
||||
<Auth :currentPage="currentPage" @update="navigateTo" />
|
||||
|
||||
<div v-if="currentPage === 'setings'">
|
||||
<template v-if="currentPage !== 'admin-panel'">
|
||||
<div class="sm:flex">
|
||||
<All_new_section :currentPage="currentPage" @update="handleUpdate" />
|
||||
<Setings />
|
||||
<NavBar :currentPage="currentPage" @update="navigateTo" />
|
||||
<NewsFeed v-if="currentPage === 'rezylt'" filter="all" />
|
||||
<Settings v-else-if="currentPage === 'setings'" />
|
||||
<Sources v-else-if="currentPage === 'istochnik'" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- <div v-if="currentPage === 'status'">
|
||||
<div class="sm:flex">
|
||||
<All_new_section :currentPage="currentPage" @update="handleUpdate" />
|
||||
<General_section filter="status" />
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
<div v-if="currentPage === 'istochnik'">
|
||||
<div class="sm:flex">
|
||||
<All_new_section :currentPage="currentPage" @update="handleUpdate" />
|
||||
<Istochnik />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</template>
|
||||
|
||||
<style>
|
||||
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user