Skip to content
On this page

Installation

Compatibility

To use TeleVue, you need to have this version of Vue or higher:

Install with npm:

shell
npm install televue

Install with yarn:

shell
yarn add televue

Or if you just want to try it out with unpkg:

html
<script src="https://unpkg.com/televue"></script>

Basic usage

Just import TeleVue component in <script setup> of your SFCs and use it in <template>:

vue
<script setup>
import { WidgetPost } from 'televue'
</script>

<template>
  <WidgetPost post="televuenews/3" />
</template>

Same thing with TeleVue composables:

vue
<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>

Released under the MIT License.