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.

41 lines
867 B

  1. <template lang="pug">
  2. div {{ currentPath }}
  3. </template>
  4. <script>
  5. export default {
  6. name: 'history',
  7. props: ['currentPath'],
  8. data() {
  9. return {
  10. tree: []
  11. }
  12. },
  13. methods: {
  14. fetch(basePath) {
  15. let self = this
  16. self.$store.dispatch('startLoading')
  17. self.$nextTick(() => {
  18. socket.emit('treeFetch', { basePath }, (data) => {
  19. if (self.tree.length > 0) {
  20. let branch = self._.last(self.tree)
  21. branch.hasChildren = true
  22. self._.find(branch.pages, { _id: basePath }).isActive = true
  23. }
  24. self.tree.push({
  25. hasChildren: false,
  26. pages: data
  27. })
  28. self.$store.dispatch('stopLoading')
  29. })
  30. })
  31. },
  32. goto(entryPath) {
  33. window.location.assign(siteRoot + '/' + entryPath)
  34. }
  35. },
  36. mounted() {
  37. }
  38. }
  39. </script>