feat: infinity scroll, load more, resore scroll
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user