Files
chatwoot/app/javascript/ui/ChatButton.vue
Shivam Mishra 355b587c2c feat: try
2025-05-07 22:13:17 +05:30

37 lines
661 B
Vue

<script setup>
import { computed } from 'vue';
defineProps({
label: {
type: String,
default: 'Click me',
},
});
// eslint-disable-next-line no-underscore-dangle
const store = window.__CHATWOOT_STORE__;
// Example of accessing store state
const currentUser = computed(() => {
try {
return store.getters.getCurrentUser;
} catch (e) {
return null;
}
});
const handleClick = () => {};
</script>
<template>
<button class="cha-button" @click="handleClick">
{{ currentUser }} {{ label }}
</button>
</template>
<style scoped>
.cha-button {
@apply bg-primary-600 hover:bg-primary-700 text-white px-4 py-2 rounded-md;
}
</style>