From b958feaec751b2e3a4134f925a74c75d5d2d1b42 Mon Sep 17 00:00:00 2001 From: Nikita Kiselev Date: Thu, 10 Jul 2025 23:14:09 +0300 Subject: [PATCH] feat: add telegram api --- spa/index.html | 19 ++++++++++--------- spa/src/components/ProductList.vue | 10 ++++++++-- spa/src/main.js | 4 ++++ 3 files changed, 22 insertions(+), 11 deletions(-) diff --git a/spa/index.html b/spa/index.html index 8388c4b..d87d0eb 100644 --- a/spa/index.html +++ b/spa/index.html @@ -1,13 +1,14 @@ - - - - + + + + + Vite + Vue - - -
- - + + +
+ + diff --git a/spa/src/components/ProductList.vue b/spa/src/components/ProductList.vue index 9944e73..c7bdd7c 100644 --- a/spa/src/components/ProductList.vue +++ b/spa/src/components/ProductList.vue @@ -4,7 +4,9 @@

Products

- +

{{ product.name }}

@@ -25,4 +27,8 @@ onMounted(async () => { const {data} = await $fetch('https://ocstore.nikitakiselev.ru/index.php?route=extension/tgshop/handle&api_action=products'); products.value = data; }); - \ No newline at end of file + +function handleHaptic() { + window.Telegram?.WebApp?.HapticFeedback?.impactOccurred?.('heavy'); +} + diff --git a/spa/src/main.js b/spa/src/main.js index fe5bae3..0bdb444 100644 --- a/spa/src/main.js +++ b/spa/src/main.js @@ -3,3 +3,7 @@ import App from './App.vue' import './style.css' createApp(App).mount('#app') + +const tg = window.Telegram.WebApp; +tg.ready(); +tg.expand(); // на весь экран \ No newline at end of file