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.

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