diff --git a/index.js b/index.js index 6b0065d..373f778 100644 --- a/index.js +++ b/index.js @@ -41,17 +41,16 @@ module.exports = { var lang = this.lang||'text'; var theme = this.theme||'chrome'; - this.$emit('init'); - require('brace/ext/emmet'); var editor = vm.editor = ace.edit(this.$el); + + this.$emit('init',editor); + editor.$blockScrolling = Infinity; editor.setOption("enableEmmet", true); - editor.getSession().setMode('ace/mode/'+lang); editor.setTheme('ace/theme/'+theme); - editor.setValue(this.value,1); editor.on('change',function () { @@ -60,5 +59,6 @@ module.exports = { vm.contentBackup = content; }); + } }