cabinet/frontend/src/components/Editor.vue

38 lines
746 B
Vue
Raw Normal View History

2019-11-01 17:09:17 +00:00
<template>
<div>
<editor v-model="text" @init="editorInit" lang="asciidoc" theme="github" width="100%" height="500" />
</div>
</template>
<script>
export default {
name: "Editor",
data: function () {
return {
text: ''
}
},
props: {
content: String
},
components: {
editor: require('vue2-ace-editor')
},
watch: {
content: function(newValue) {
this.text = newValue
}
},
methods: {
editorInit: function () {
require('brace/ext/language_tools') //language extension prerequsite...
require('brace/mode/asciidoc') //language
require('brace/theme/github')
}
}
}
</script>
<style scoped>
</style>