app.vue 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. <template lang="pug">
  2. v-app
  3. nav-header
  4. v-navigation-drawer.primary(
  5. dark
  6. app
  7. clipped
  8. :mini-variant='$vuetify.breakpoint.md || $vuetify.breakpoint.sm'
  9. mini-variant-width='80'
  10. mobile-break-point='600'
  11. :temporary='$vuetify.breakpoint.xs'
  12. v-model='navShown'
  13. )
  14. v-list(dense)
  15. v-list-tile.pt-2(href='/')
  16. v-list-tile-avatar: v-icon home
  17. v-list-tile-title Home
  18. v-divider.my-2
  19. v-subheader.pl-4 Navigation
  20. v-list-tile
  21. v-list-tile-avatar: v-icon stars
  22. v-list-tile-title The Universe
  23. v-list-tile
  24. v-list-tile-avatar: v-icon directions_boat
  25. v-list-tile-title Ships
  26. v-list-tile
  27. v-list-tile-avatar: v-icon local_airport
  28. v-list-tile-title Airports
  29. v-content
  30. v-toolbar(color='grey lighten-3', flat, dense)
  31. v-btn.pl-0(v-if='$vuetify.breakpoint.xsOnly', flat, @click='toggleNavigation')
  32. v-icon(color='grey darken-2', left) menu
  33. span Navigation
  34. v-breadcrumbs.pl-0(v-else, divider='/')
  35. v-breadcrumbs-item Universe
  36. v-breadcrumbs-item Galaxy
  37. v-breadcrumbs-item Solar System
  38. v-breadcrumbs-item Planet Earth
  39. v-spacer
  40. status-indicator(active, pulse)
  41. v-divider
  42. v-layout(row)
  43. v-flex(xs12, lg9, xl10)
  44. v-toolbar(color='grey lighten-4', flat, :height='90')
  45. div
  46. .headline.grey--text.text--darken-3 {{title}}
  47. .caption.grey--text.text--darken-1 {{description}}
  48. v-divider
  49. .contents
  50. slot(name='contents')
  51. v-flex(lg3, xl2, fill-height, v-if='$vuetify.breakpoint.lgAndUp')
  52. v-toolbar(color='grey lighten-4', flat, :height='90')
  53. div
  54. .caption.grey--text.text--lighten-1 Last edited by
  55. .body-2.grey--text.text--darken-3 John Doe
  56. .caption.grey--text.text--darken-1 Monday at 12:34 PM
  57. v-spacer
  58. v-tooltip(bottom)
  59. v-btn(icon, slot='activator')
  60. v-icon(color='grey') edit
  61. span Edit Page
  62. v-divider
  63. v-list.grey.lighten-3.pb-3(dense)
  64. v-subheader.pl-4.primary--text Table of contents
  65. vue-tree-navigation.treenav(:items='toc', :defaultOpenLevel='1')
  66. v-divider
  67. v-list.grey.lighten-4(dense)
  68. v-subheader.pl-4.teal--text Tags
  69. v-list-tile
  70. v-list-tile-avatar: v-icon(color='teal') label
  71. v-list-tile-title Astrophysics
  72. v-divider(inset)
  73. v-list-tile
  74. v-list-tile-avatar: v-icon(color='teal') label
  75. v-list-tile-title Space
  76. v-divider(inset)
  77. v-list-tile
  78. v-list-tile-avatar: v-icon(color='teal') label
  79. v-list-tile-title Planets
  80. v-divider
  81. v-toolbar(color='grey lighten-3', flat, dense)
  82. v-spacer
  83. v-btn(icon): v-icon(color='grey') bookmark
  84. v-btn(icon): v-icon(color='grey') share
  85. v-btn(icon): v-icon(color='grey') print
  86. v-spacer
  87. nav-footer
  88. </template>
  89. <script>
  90. import { StatusIndicator } from 'vue-status-indicator'
  91. export default {
  92. components: {
  93. StatusIndicator
  94. },
  95. props: {
  96. title: {
  97. type: String,
  98. default: 'Untitled Page'
  99. },
  100. description: {
  101. type: String,
  102. default: ''
  103. }
  104. },
  105. data() {
  106. return {
  107. navOpen: false,
  108. toc: [
  109. {
  110. name: 'Introduction',
  111. element: 'introduction'
  112. },
  113. {
  114. name: 'Cities',
  115. element: 'cities',
  116. children: [
  117. {
  118. name: 'New York',
  119. element: 'contact',
  120. children: [
  121. { name: 'E-mail', element: 'email' },
  122. { name: 'Phone', element: 'phone' }
  123. ]
  124. },
  125. {
  126. name: 'Chicago',
  127. element: 'contact',
  128. children: [
  129. { name: 'E-mail', element: 'email' },
  130. { name: 'Phone', element: 'phone' }
  131. ]
  132. }
  133. ]
  134. },
  135. { name: 'Population', external: 'https://github.com' }
  136. ]
  137. }
  138. },
  139. computed: {
  140. navShown: {
  141. get() { return this.navOpen || this.$vuetify.breakpoint.smAndUp },
  142. set(val) { this.navOpen = val }
  143. }
  144. },
  145. methods: {
  146. toggleNavigation () {
  147. this.navOpen = !this.navOpen
  148. }
  149. }
  150. }
  151. </script>
  152. <style lang="scss">
  153. </style>