Guest User

Untitled

a guest
Jul 19th, 2018
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.45 KB | None | 0 0
  1. <template>
  2. <v-app id="app" class="fill-height">
  3. <v-layout row class="fill-height" style="padding-bottom:60px" >
  4. <v-flex md8 offset-md2 style="overflow:auto;" class="pr-3 pl-3" v-if="HANDLE" ref="chatContainer">
  5. <div v-for="chat in CHATS" class="mt-4 mb-4" style="max-width:80%">
  6. <app-chat-item :chat="chat"></app-chat-item>
  7. </div>
  8. </v-flex>
  9. <v-flex v-else md4 offset-md4 class="text-xs-center">
  10. <app-chat-handle></app-chat-handle>
  11. </v-flex>
  12. <v-bottom-nav :value="true" absolute color="blue">
  13. <v-layout>
  14. <app-chat-box></app-chat-box>
  15. </v-layout>
  16. </v-bottom-nav>
  17. </v-layout>
  18. </v-app>
  19. </template>
  20.  
  21. <script>
  22. import {mapGetters} from 'vuex'
  23. import chatItem from './components/ChatItem'
  24. import chatHandle from './components/Handle'
  25. import chatBox from './components/ChatBox'
  26.  
  27. export default {
  28. components : {
  29. appChatItem : chatItem,
  30. appChatHandle : chatHandle,
  31. appChatBox : chatBox,
  32. },
  33. computed:{
  34. ...mapGetters(['CHATS','HANDLE'])
  35. },
  36. mounted(){
  37. this.$store.dispatch("SET_CHAT");
  38. },
  39. updated(){
  40. var container = this.$refs.chatContainer;
  41. container.scrollTop = container.scrollHeight;
  42. },
  43. sockets : {
  44. connect: function(){
  45. console.log('socket connected');
  46. },
  47. chat : function(val){
  48. this.$store.dispatch("ADD_CHAT",val);
  49. }
  50. }
  51. }
  52.  
  53. </script>
  54.  
  55. <style>
  56. html,body{
  57. height: 100%
  58. }
  59. </style>
Add Comment
Please, Sign In to add comment