效果图
引用
npm install --save-dev vue2-ace-editor
使用
//代码编辑器
import Editor from 'vue2-ace-editor'
components: { Editor },
代码
<editor height="500" width="500" v-model="content" :options="{ enableBasicAutocompletion: true, enableSnippets: true,
enableLiveAutocompletion: true,
tabSize:6,
fontSize:14,
showPrintMargin:false}" :lang="'html'">
</editor>
vue2-ace-editor F12 页面报错问题
1、注释模块里面的这个代码//editor.setTheme('ace/theme/'+theme);
2、去掉lang = html的配置