content-view.component.js 396 Bytes
Newer Older
1
'use strict'
2

3 4
/* global $ */

5 6 7 8 9 10
export default {
  name: 'content-view',
  data() {
    return {}
  },
  mounted() {
11 12 13 14 15 16 17 18 19
    let self = this
    $('a.toc-anchor').each((i, elm) => {
      let hashText = $(elm).attr('href').slice(1)
      $(elm).on('click', (ev) => {
        ev.stopImmediatePropagation()
        self.$store.dispatch('anchor/open', hashText)
        return false
      })
    })
20
  }
21
}