Skip to content

Instantly share code, notes, and snippets.

@sanath-kumar
Last active July 26, 2018 06:12
Show Gist options
  • Select an option

  • Save sanath-kumar/ae82be4a1aecc7fab44030113eb3e4c8 to your computer and use it in GitHub Desktop.

Select an option

Save sanath-kumar/ae82be4a1aecc7fab44030113eb3e4c8 to your computer and use it in GitHub Desktop.
<template lang="html">
<v-flex md8 offset-md2 class="pt-1" @submit.prevent="sendMessage">
<v-form style="width:100%">
<v-text-field
label="Solo"
placeholder="Type Your Message"
v-model="message"
solo
ref="message"
>
</v-text-field>
</v-form>
</v-flex>
</template>
<script>
export default {
data () {
return {
message : ""
}
},
methods : {
async sendMessage(){
let handle = this.$store.getters.HANDLE;
if(this.message){
let message = {
handle : handle,
message : this.message
}
let response = await this.$socket.emit('chat',message)
this.message = ""
}
},
}
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment