fix: view.vue.container.inbox (empty input when message sent)

This commit is contained in:
xdrm-brackets 2017-12-05 18:12:26 +01:00
parent ba14390582
commit 3f646bcd6c
1 changed files with 12 additions and 2 deletions

View File

@ -7,7 +7,7 @@
<span class='content'>{{ msg[1] }}</span> <span class='content'>{{ msg[1] }}</span>
</div> </div>
<form class='msg-input' @submit.prevent='gstore.func.sendMessage(gstore.new_msg)'> <form class='msg-input' @submit.prevent='new_message'>
<input type='text' placeholder='Nouveau message..' id='msg-new-content' v-model='gstore.new_msg'> <input type='text' placeholder='Nouveau message..' id='msg-new-content' v-model='gstore.new_msg'>
<button></button> <button></button>
</form> </form>
@ -20,6 +20,16 @@
<script> <script>
export default { export default {
name: 'CONTAINER_INBOX', name: 'CONTAINER_INBOX',
data(){ return { gstore: window.gstore.data }; } 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> </script>