source-view.component.js 701 Bytes
Newer Older
1 2 3 4 5 6 7 8
'use strict'

export default {
  name: 'source-view',
  data() {
    return {}
  },
  mounted() {
9
    let self = this
10
    FuseBox.import('/js/ace/ace.js', (ace) => {
11 12 13 14 15 16
      let scEditor = ace.edit('source-display')
      scEditor.setTheme('ace/theme/dawn')
      scEditor.getSession().setMode('ace/mode/markdown')
      scEditor.setOption('fontSize', '14px')
      scEditor.setOption('hScrollBarAlwaysVisible', false)
      scEditor.setOption('wrap', true)
17
      scEditor.setOption('showPrintMargin', false)
18 19 20
      scEditor.setReadOnly(true)
      scEditor.renderer.updateFull()
      scEditor.renderer.on('afterRender', () => {
21
        self.$store.dispatch('pageLoader/complete')
22 23 24 25
      })
    })
  }
}