Guest User

Untitled

a guest
Jan 16th, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. methods:{
  2. send(){
  3. if(this.message.length != 0)
  4. {
  5. this.chat.message.push(this.message);
  6. axios.post('admin/send', {
  7. message : this.message
  8. })
  9. .then(response => {
  10. // console.log(response);
  11. this.message = '';
  12. })
  13. .catch(error => {
  14. // console.log(error);
  15. });
  16. }
  17. }
  18. }, mounted(){
  19. Echo.private('chat')
  20. .listen('ChatEvent', (e) => {
  21. //this.chat.message.push(e.message);
  22. console.log(e);
  23. });
  24. }
Add Comment
Please, Sign In to add comment