content-view.component.js 382 B

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