You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

87 lines
2.1 KiB

  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)
  6. v-list-item.pt-2(to='/profile')
  7. v-list-item-action: v-icon account_circle
  8. v-list-item-title Profile
  9. v-list-item(to='/preferences')
  10. v-list-item-action: v-icon settings
  11. v-list-item-title Preferences
  12. v-divider.my-2
  13. v-subheader My Content
  14. v-list-item(to='/pages')
  15. v-list-item-action: v-icon pages
  16. v-list-item-title Pages
  17. v-list-item(to='/comments')
  18. v-list-item-action: v-icon question_answer
  19. v-list-item-title Comments
  20. v-content
  21. transition(name='profile-router')
  22. router-view
  23. nav-footer
  24. notify
  25. search-results
  26. </template>
  27. <script>
  28. import VueRouter from 'vue-router'
  29. /* global WIKI, siteConfig */
  30. const router = new VueRouter({
  31. mode: 'history',
  32. base: '/p',
  33. routes: [
  34. { path: '/', redirect: '/profile' },
  35. { path: '/profile', component: () => import(/* webpackChunkName: "profile" */ './profile/profile.vue') },
  36. { path: '/preferences', component: () => import(/* webpackChunkName: "profile" */ './profile/preferences.vue') },
  37. { path: '/pages', component: () => import(/* webpackChunkName: "profile" */ './profile/pages.vue') },
  38. { path: '/comments', component: () => import(/* webpackChunkName: "profile" */ './profile/comments.vue') }
  39. ]
  40. })
  41. router.beforeEach((to, from, next) => {
  42. WIKI.$store.commit('loadingStart', 'profile')
  43. next()
  44. })
  45. router.afterEach((to, from) => {
  46. WIKI.$store.commit('loadingStop', 'profile')
  47. })
  48. export default {
  49. data() {
  50. return {
  51. profileDrawerShown: true
  52. }
  53. },
  54. computed: {
  55. darkMode() { return siteConfig.darkMode }
  56. },
  57. router,
  58. created() {
  59. this.$store.commit('page/SET_MODE', 'profile')
  60. }
  61. }
  62. </script>
  63. <style lang='scss'>
  64. .profile-router {
  65. &-enter-active, &-leave-active {
  66. transition: opacity .25s ease;
  67. opacity: 1;
  68. }
  69. &-enter-active {
  70. transition-delay: .25s;
  71. }
  72. &-enter, &-leave-to {
  73. opacity: 0;
  74. }
  75. }
  76. </style>