2017-05-23 04:27:16 +00:00
|
|
|
export default {
|
|
|
|
name: 'source-view',
|
|
|
|
data() {
|
|
|
|
return {}
|
|
|
|
},
|
|
|
|
mounted() {
|
2017-05-26 04:12:38 +00:00
|
|
|
let self = this
|
2017-06-26 21:47:01 +00:00
|
|
|
FuseBox.import('/js/ace/ace.js', (ace) => {
|
2017-05-23 04:27:16 +00:00
|
|
|
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)
|
2017-05-28 18:34:50 +00:00
|
|
|
scEditor.setOption('showPrintMargin', false)
|
2017-05-23 04:27:16 +00:00
|
|
|
scEditor.setReadOnly(true)
|
|
|
|
scEditor.renderer.updateFull()
|
|
|
|
scEditor.renderer.on('afterRender', () => {
|
2017-05-26 04:12:38 +00:00
|
|
|
self.$store.dispatch('pageLoader/complete')
|
2017-05-23 04:27:16 +00:00
|
|
|
})
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|