0.6.1 • Published 14 days ago

vue-tg v0.6.1

Weekly downloads
-
License
MIT
Repository
github
Last release
14 days ago

vue-tg - Telegram integration for Vue

A package for seamless integration of Telegram Mini Apps and Telegram Widgets features.

Documentation »

Usage Example

<script lang="ts" setup>
import { MainButton, useWebAppPopup } from 'vue-tg'

const { showAlert } = useWebAppPopup()
</script>

<template>
  <MainButton text="Open alert" @click="() => showAlert('Hello!')" />
</template>

Installation

To connect your Mini App to the Telegram client, place the script telegram-web-app.js in the <head> tag before any other scripts, using this code:

<script src="https://telegram.org/js/telegram-web-app.js"></script>

After that, install package:

npm i vue-tg

Global Aliases (Optional)

Register on Vue instance:

import VueTelegram from 'vue-tg'

Vue.use(VueTelegram)

After that, you can use global aliases for components

<script lang="ts" setup>
import { Alert } from 'vue-tg'
</script>

<template>
  <Alert message="Hello!" />
</template>

<!-- Same with using an alias of the component -->

<template>
  <tg-alert message="Hello!" />
</template>

Documentation

Widgets

Components

Mini Apps

Components

Composables

0.6.1

14 days ago

0.6.0

1 month ago

0.5.0

1 month ago

0.4.0

3 months ago

0.3.0

3 months ago

0.2.0

4 months ago

0.1.0

7 months ago

0.0.3

7 months ago

0.1.1

7 months ago

0.0.2

7 months ago

0.0.1

1 year ago