source-view.component.js 735 B

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