A simple Vue 3 wrapper for Ybug's Feedback Widget API.
For Vue 2 version of the plugin please check this gist: Ybug Plugin for Vue 2.
npm install --save ybug-vue
Install the plugin. You can use any setting mentioned in the documentation.
import { createApp } from 'vue';
import Ybug from 'ybug-vue';
const app = createApp({});
app.use(Ybug, {
id: 'Your Project ID goes here',
/* optional options */
settings: {
language_override: 'cs',
/* ... */
}
});
You can use any method mentioned in the official documentation.
You can inject('ybug')
in your Composition API components.
<script setup>
import { inject } from "vue";
const ybug = inject("ybug");
</script>
<template>
<button @click="ybug.open('feedback')">Feedback</button>
</template>
ybug-vue
plugin exposes $ybug
object in components using the Options API.
<template>
<button @click="$ybug.open('feedback')">Feedback</button>
</template>