feat: infinity scroll, load more, resore scroll

This commit is contained in:
Nikita Kiselev
2025-07-23 13:26:22 +03:00
parent 6a14ad0a74
commit bb2ee38118
9 changed files with 188 additions and 106 deletions

View File

@@ -5,14 +5,6 @@ import { VueTelegramPlugin } from 'vue-tg';
import { router } from './router';
import { createPinia } from 'pinia';
const config = {
night_auto: true,
theme: {
light: 'light',
dark: 'dark',
}
};
const pinia = createPinia();
const app = createApp(App);
app
@@ -22,21 +14,19 @@ app
app.mount('#app');
const productsStore = useProductsStore();
productsStore.fetchHomeProducts();
const settings = useSettingsStore();
const categoriesStore = useCategoriesStore();
categoriesStore.fetchTopCategories();
import {useProductsStore} from "@/stores/ProductsStore.js";
import {useCategoriesStore} from "@/stores/CategoriesStore.js";
import {useSettingsStore} from "@/stores/SettingsStore.js";
if (config.night_auto) {
document.documentElement.setAttribute('data-theme', config.theme[this.colorScheme]);
if (settings.night_auto) {
window.Telegram.WebApp.onEvent('themeChanged', function () {
document.documentElement.setAttribute('data-theme', config.theme[this.colorScheme]);
document.documentElement.setAttribute('data-theme', settings.theme[this.colorScheme]);
});
} else {
document.documentElement.setAttribute('data-theme', config.theme.light);
document.documentElement.setAttribute('data-theme', settings.theme.light);
}
window.Telegram.WebApp.ready();