ToolsLayout.vue 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <template>
  2. <div class="fullScreen d-flex flex-column">
  3. <div>
  4. <v-toolbar
  5. color="indigo"
  6. dark
  7. >
  8. <v-btn class="mr-3" text @click="$router.push('/')">
  9. <v-icon left>mdi-home-circle</v-icon>
  10. 返回首页
  11. </v-btn>
  12. <v-toolbar-title>{{ $route.meta.title }}</v-toolbar-title>
  13. <v-spacer></v-spacer>
  14. <v-menu offset-y rounded>
  15. <template v-slot:activator="{ on, attrs }">
  16. <v-btn
  17. icon
  18. v-bind="attrs"
  19. v-on="on">
  20. <v-icon>mdi-dots-vertical</v-icon>
  21. </v-btn>
  22. </template>
  23. <v-list min-width="200">
  24. <v-list-item link @click="$store.dispatch('user/userLogout')">
  25. <v-list-item-icon>
  26. <v-icon>mdi-logout</v-icon>
  27. </v-list-item-icon>
  28. <v-list-item-title>
  29. 退出登录
  30. </v-list-item-title>
  31. </v-list-item>
  32. </v-list>
  33. </v-menu>
  34. </v-toolbar>
  35. </div>
  36. <div class="layout-content">
  37. <keep-alive v-if="$route.meta.keepAlive">
  38. <router-view />
  39. </keep-alive>
  40. <router-view v-else />
  41. </div>
  42. </div>
  43. </template>
  44. <script>
  45. export default {
  46. name: 'ToolsLayout'
  47. }
  48. </script>
  49. <style lang="scss" scoped>
  50. .fullScreen {
  51. width: 100%;
  52. height: 100%;
  53. }
  54. .layout-content {
  55. flex: 1;
  56. height: 0;
  57. }
  58. </style>