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.

85 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. </template>
  25. <script>
  26. import VueRouter from 'vue-router'
  27. /* global WIKI, siteConfig */
  28. const router = new VueRouter({
  29. mode: 'history',
  30. base: '/p',
  31. routes: [
  32. { path: '/', redirect: '/profile' },
  33. { path: '/profile', component: () => import(/* webpackChunkName: "profile" */ './profile/profile.vue') },
  34. { path: '/preferences', component: () => import(/* webpackChunkName: "profile" */ './profile/preferences.vue') },
  35. { path: '/pages', component: () => import(/* webpackChunkName: "profile" */ './profile/pages.vue') },
  36. { path: '/comments', component: () => import(/* webpackChunkName: "profile" */ './profile/comments.vue') }
  37. ]
  38. })
  39. router.beforeEach((to, from, next) => {
  40. WIKI.$store.commit('loadingStart', 'profile')
  41. next()
  42. })
  43. router.afterEach((to, from) => {
  44. WIKI.$store.commit('loadingStop', 'profile')
  45. })
  46. export default {
  47. data() {
  48. return {
  49. profileDrawerShown: true
  50. }
  51. },
  52. computed: {
  53. darkMode() { return siteConfig.darkMode }
  54. },
  55. router,
  56. created() {
  57. this.$store.commit('page/SET_MODE', 'profile')
  58. }
  59. }
  60. </script>
  61. <style lang='scss'>
  62. .profile-router {
  63. &-enter-active, &-leave-active {
  64. transition: opacity .25s ease;
  65. opacity: 1;
  66. }
  67. &-enter-active {
  68. transition-delay: .25s;
  69. }
  70. &-enter, &-leave-to {
  71. opacity: 0;
  72. }
  73. }
  74. </style>