@goya24/vue
@goya24/vue
The goya24 support messenger for Vue 3. A plugin that mounts it, a composable that controls it. ~0.6 kB on top of @goya24/messenger.
npm i @goya24/vue
import { createGoya24 } from "@goya24/vue";
app.use(createGoya24({ key: import.meta.env.VITE_GOYA24_KEY, locale: "fa" }));
<script setup lang="ts">
import { useGoya24 } from "@goya24/vue";
const { open, state } = useGoya24();
</script>
<template>
<button @click="open">
پشتیبانی <span v-if="state.unread">{{ state.unread }}</span>
</button>
</template>
useGoya24() returns open, close, toggle, identify(user), update(options), destroy and a reactive state (ready, open, unread). A site with its own bubble passes launcher: false to createGoya24() and opens the panel from it; ours is then not drawn at all. update({ launcher, alignment, padding }) changes those after load without a reload — from the setup() of a route that wants the bubble gone, say; null hands a key back to the workspace's setting. It is also available as this.$goya24 in the Options API. The messenger mounts after app.mount() and is removed on app.unmount(); calls made during a component's setup() are kept until then.
Full documentation in the repository README.
MIT © Goya24
Related Packages
Nuxt module for the goya24 support messenger: the key from nuxt.config or the en...
Chatgram live chat messenger + contact form widget in 117 languages (right-to-le...
Vue Messenger provides an expressive suite of features and customization
Version History
| Version | Released | Vue | License |
|---|---|---|---|
| 0.3.0 | >=3.3 | MIT | |
| 0.2.0 | >=3.3 | MIT | |
| 0.1.0 | >=3.3 | MIT |