refactor: Pre-render TeX + MathML server-side to SVG
This commit is contained in:
		
							
								
								
									
										41
									
								
								client/js/components/history.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										41
									
								
								client/js/components/history.vue
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,41 @@
 | 
			
		||||
<template lang="pug">
 | 
			
		||||
  div {{ currentPath }}
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
export default {
 | 
			
		||||
  name: 'history',
 | 
			
		||||
  props: ['currentPath'],
 | 
			
		||||
  data() {
 | 
			
		||||
    return {
 | 
			
		||||
      tree: []
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
  methods: {
 | 
			
		||||
    fetch(basePath) {
 | 
			
		||||
      let self = this
 | 
			
		||||
      self.$store.dispatch('startLoading')
 | 
			
		||||
      self.$nextTick(() => {
 | 
			
		||||
        socket.emit('treeFetch', { basePath }, (data) => {
 | 
			
		||||
          if (self.tree.length > 0) {
 | 
			
		||||
            let branch = self._.last(self.tree)
 | 
			
		||||
            branch.hasChildren = true
 | 
			
		||||
            self._.find(branch.pages, { _id: basePath }).isActive = true
 | 
			
		||||
          }
 | 
			
		||||
          self.tree.push({
 | 
			
		||||
            hasChildren: false,
 | 
			
		||||
            pages: data
 | 
			
		||||
          })
 | 
			
		||||
          self.$store.dispatch('stopLoading')
 | 
			
		||||
        })
 | 
			
		||||
      })
 | 
			
		||||
    },
 | 
			
		||||
    goto(entryPath) {
 | 
			
		||||
      window.location.assign(siteRoot + '/' + entryPath)
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
  mounted() {
 | 
			
		||||
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
</script>
 | 
			
		||||
		Reference in New Issue
	
	Block a user