profile.vue 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. <template lang='pug'>
  2. v-app(:dark='$vuetify.theme.dark').profile
  3. nav-header
  4. v-navigation-drawer.pb-0(v-model='profileDrawerShown', app, fixed, clipped, left, permanent)
  5. v-list(dense, nav)
  6. v-list-item(to='/profile', color='primary')
  7. v-list-item-action: v-icon mdi-face-profile
  8. v-list-item-content
  9. v-list-item-title {{$t('profile:title')}}
  10. //- v-list-item(to='/preferences', disabled)
  11. //- v-list-item-action: v-icon(color='grey lighten-1') mdi-cog-outline
  12. //- v-list-item-content
  13. //- v-list-item-title Preferences
  14. //- v-list-item-subtitle.caption.grey--text.text--lighten-1 Coming soon
  15. v-list-item(to='/pages', color='primary')
  16. v-list-item-action: v-icon mdi-file-document-outline
  17. v-list-item-content
  18. v-list-item-title {{$t('profile:pages.title')}}
  19. //- v-list-item(to='/comments', disabled)
  20. //- v-list-item-action: v-icon(color='grey lighten-1') mdi-message-reply-text
  21. //- v-list-item-content
  22. //- v-list-item-title {{$t('profile:comments.title')}}
  23. //- v-list-item-subtitle.caption.grey--text.text--lighten-1 Coming soon
  24. v-content(:class='$vuetify.theme.dark ? "grey darken-4" : "grey lighten-5"')
  25. transition(name='profile-router')
  26. router-view
  27. nav-footer
  28. notify
  29. search-results
  30. </template>
  31. <script>
  32. import VueRouter from 'vue-router'
  33. /* global WIKI */
  34. const router = new VueRouter({
  35. mode: 'history',
  36. base: '/p',
  37. routes: [
  38. { path: '/', redirect: '/profile' },
  39. { path: '/profile', component: () => import(/* webpackChunkName: "profile" */ './profile/profile.vue') },
  40. { path: '/pages', component: () => import(/* webpackChunkName: "profile" */ './profile/pages.vue') },
  41. { path: '/comments', component: () => import(/* webpackChunkName: "profile" */ './profile/comments.vue') }
  42. ]
  43. })
  44. router.beforeEach((to, from, next) => {
  45. WIKI.$store.commit('loadingStart', 'profile')
  46. next()
  47. })
  48. router.afterEach((to, from) => {
  49. WIKI.$store.commit('loadingStop', 'profile')
  50. })
  51. export default {
  52. i18nOptions: { namespaces: 'profile' },
  53. data() {
  54. return {
  55. profileDrawerShown: true
  56. }
  57. },
  58. router,
  59. created() {
  60. this.$store.commit('page/SET_MODE', 'profile')
  61. }
  62. }
  63. </script>
  64. <style lang='scss'>
  65. .profile-router {
  66. &-enter-active, &-leave-active {
  67. transition: opacity .25s ease;
  68. opacity: 1;
  69. }
  70. &-enter-active {
  71. transition-delay: .25s;
  72. }
  73. &-enter, &-leave-to {
  74. opacity: 0;
  75. }
  76. }
  77. .profile-header {
  78. display: flex;
  79. justify-content: flex-start;
  80. align-items: center;
  81. &-title {
  82. margin-left: 1rem;
  83. }
  84. }
  85. </style>