-
-
Save ammezie/8780917b6ad3ea8fa451b1e4fb36b5e9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// resources/js/components/Chat.vue | |
<template> | |
<div id="chat"> | |
<button class="btn btn-primary c-chat-widget-button" ref="button" @click.prevent="toggleModal()">C</button> | |
<div class="c-chat-widget" ref="modal" :class="{show: modal.show}"> | |
<div class="c-chat-widget-dialog"> | |
<div class="c-chat-widget-content"> | |
<div class="c-chat-widget-header">Chat With Us Admin</div> | |
<div class="c-chat-widget-body"> | |
<div class="c-chat-widget-bubble c-chat-widget-bubble-left row" v-for="msg in messageData"> | |
<div class="c-chat-widget-bubble-icon">{{msg.user.id}}</div> | |
<div class="c-chat-widget-bubble-text"> | |
{{msg.text}} | |
</div> | |
</div> | |
</div> | |
<div class="c-chat-widget-footer"> | |
<form @submit.prevent="sendmessage"> | |
<textarea name="" id="" cols="30" v-model="message" rows="10" class="c-chat-widget-text" placeholder="Enter Text Here"></textarea> | |
<button class="btn btn-block btn-success">Send Message</button> | |
</form> | |
</div> | |
</div> | |
</div> | |
</div> | |
</div> | |
</template> | |
<script> | |
export default { | |
data() { | |
return { | |
modal: { | |
show: false, | |
}, | |
message: '', | |
messageData: [] | |
} | |
}, | |
mounted() { | |
}, | |
methods: { | |
toggleModal() { | |
this.modal.show = !this.modal.show; | |
}, | |
showModal() { | |
this.modal.show = true; | |
}, | |
hideModal() { | |
this.modal.show = false; | |
}, | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment