main/view/vue/container/inbox.vue

35 lines
754 B
Vue
Raw Normal View History

<template>
<div id='CONTAINER' class='message'>
<div v-for='msg in gstore.notif[1].data' :class="msg[0] == gstore.server.session.name ? 'me' : ''">
<span class='author'>{{ msg[0] }}</span>
<span class='content'>{{ msg[1] }}</span>
</div>
<form class='msg-input' @submit.prevent='new_message'>
2017-12-05 12:32:42 +00:00
<input type='text' placeholder='Nouveau message..' id='msg-new-content' v-model='gstore.new_msg'>
<button></button>
</form>
</div>
2017-12-05 12:32:42 +00:00
</template>
<script>
export default {
name: 'CONTAINER_INBOX',
data(){ return { gstore: window.gstore.data }; },
methods: {
new_message(msg){
// {1} Send message //
this.gstore.func.sendMessage(this.gstore.new_msg);
// {2} Empty input //
this.gstore.new_msg = '';
}
}
}
</script>