Blame view

src/components/chat/ChatLayout.vue 1.76 KB
93a68cfa1   Jatinder Singh   first commit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
  <template>
    <v-app id="chat" class="chat">
      <template v-if="!$vuetify.breakpoint.smAndDown">
        <v-navigation-drawer
          class="pa-0 chat-drawer primary"
          fixed
          permanent
          app
          width="68"
          >
          <chat-menu :items="menus" class="chat-drawer--menu">
          </chat-menu>        
        </v-navigation-drawer>
        <v-content class="chat-main">
          <transition>
            <router-view></router-view>
          </transition> 
        </v-content>
      </template>  
      <template v-else>
        <v-toolbar color="primary" fixed dark>
          <v-btn icon @click="handleClick">
            <v-icon>keyboard_arrow_left</v-icon>
          </v-btn>
          <v-spacer></v-spacer>
          <v-btn icon>
            <v-icon>more_vert</v-icon>
          </v-btn>        
        </v-toolbar>
        <v-content class="chat-main">
          <transition>
            <router-view></router-view>
          </transition> 
        </v-content>      
        <v-bottom-nav :value="true" absolute color="primary" app fixed v-if="!hideBottomNav">
          <v-btn dark flat :value="item.to.path" v-for="(item, index) in menus" :key="index" :to="item.to">
            <span>{{item.text}}</span>
            <v-icon>{{item.icon}}</v-icon>
          </v-btn>
        </v-bottom-nav>      
      </template>
    </v-app>
  </template>
  
  <script>
  import API from '@/api';
  import ChatMenu from './ChatMenu';
  import VuePerfectScrollbar from 'vue-perfect-scrollbar';
  export default {
    components: {
      VuePerfectScrollbar,
      ChatMenu
    },
    data: () => ({
      menus: API.getChatMenu,
    }),
    computed: {
      hideBottomNav () {
        return this.$route.params.uuid !== undefined && this.$route.name === 'ChatMessaging';
      },
    },
    methods: {
      handleClick () {
        this.$router.go(-1);
      }
    }
  };
  </script>