标签:span let 竖线 nts lse Edito content fonts vue
1、安装依赖
npm install vue2-ace-editor
2、导入依赖,注册为子组件
import Editor from ‘vue2-ace-editor‘
//在页面组件中通过components ,注册导入的组件
components:{
			Editor
		}
3、组件使用
<editor
  height="500" 
  width="500"
  ref="editor" 
  :content="content.json" 
  v-model="content.json"
  :options="{
      enableBasicAutocompletion: true,
      enableSnippets: true,
      enableLiveAutocompletion: true,
      tabSize:6,
      fontSize:14,
      showPrintMargin:false,   //去除编辑器里的竖线
   }"
   :lang="‘json‘"
   @init="editorInit">
</editor>
init方法
editorInit(){
                 require(‘brace/theme/chrome‘)
                 require(‘brace/ext/language_tools‘) 
                 require(‘brace/mode/yaml‘)
                 require(‘brace/mode/json‘)    
                 require(‘brace/mode/less‘)
                 require(‘brace/snippets/json‘)
            }
标签:span let 竖线 nts lse Edito content fonts vue
原文地址:https://www.cnblogs.com/XXQQ123/p/14693040.html