profile.vue 2.7 KB

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