televue
v1.0.0-alpha.1
Published
Vue 3 components for Telegram widgets
Downloads
428
Maintainers
Readme
What is it?
This package provides Vue 3 components for Telegram widgets.
Check out interactive demos and docs for more info.
Installation
Install with npm:
npm install televue
Install with yarn:
yarn add televue
Or if you just want to try it out with unpkg:
<script src="https://unpkg.com/televue"></script>
Basic usage
Just import TeleVue component in <script setup>
of your SFCs and use it in <template>
:
<script setup>
import { WidgetPost } from 'televue'
</script>
<template>
<WidgetPost post="televuenews/3" />
</template>
Same thing with TeleVue composables:
<script setup>
import { useShareURL } from 'televue'
import { ref } from 'vue'
const href = ref(location.href)
const shareURL = useShareURL(href, 'Your comment')
</script>
<template>
<a
:href="shareURL"
target="_blank"
rel="noreferrer"
>
Share on Telegram
</a>
</template>