Files
chatwoot/app/javascript/dashboard/components/ui/ContextMenu.vue
2023-07-21 22:10:25 +05:30

43 lines
620 B
Vue

<template>
<div
class="fixed outline-none z-[9999] cursor-pointer"
:style="style"
tabindex="0"
@blur="$emit('close')"
>
<slot />
</div>
</template>
<script>
export default {
props: {
x: {
type: Number,
default: 0,
},
y: {
type: Number,
default: 0,
},
},
data() {
return {
left: this.x,
top: this.y,
show: false,
};
},
computed: {
style() {
return {
top: this.top + 'px',
left: this.left + 'px',
};
},
},
mounted() {
this.$nextTick(() => this.$el.focus());
},
};
</script>