1、引入
"vue2-ace-editor": "^0.0.15",
2、实例代码
<template><!--    <editor v-model="content" @init="editorInit" lang="html" style="min-height: 88vh;overflow:scroll" :options="options"theme="chrome"/>--><editor v-model="content" @init="editorInit" lang="text" style="overflow:scroll" :options="options"theme="chrome"/>
</template><script>
import {decode} from 'js-base64';export default {components: {editor: require('vue2-ace-editor')},props: {fileId: {type: String},filePath: {type: String},data: {type: String}},data() {return {content: '', options: {// enableBasicAutocompletion: true, // 启用基本自动完成// enableSnippets: true, // 启用代码段// enableLiveAutocompletion: true, // 启用实时自动完成printMargin: false,//显示设置页边距printMarginColumn: 30,//设置页边距showPrintMargin: false, //去除编辑器里的竖线highlightGutterLine: false,//高亮边线// displayIndentGuides: false, // 显示参考线enableEmmet: true, // 启用EmmettabSize: 6, // 标签大小fontSize: 14, // 设置字号useWorker: true, // 使用辅助对象enableMultiselect: true, //     选中多处readOnly: true, // 是否只读showFoldWidgets: true, // 显示折叠部件fadeFoldWidgets: true, // 淡入折叠部件wrap: true, //换行animatedScroll: true//滚动动画}}},methods: {$init() {if (this.data === undefined) {this.getXml()} else {this.content = this.data}},editorInit: function () {require('brace/ext/language_tools') //language extension prerequsite...require('brace/mode/html')require('brace/mode/javascript')    //languagerequire('brace/mode/less')require('brace/theme/chrome')require('brace/snippets/javascript') //snippet},async getXml() {const {data} = await this.$http.post('fileView/getXml', {fileId: this.fileId,filePath: this.filePath,})if (data.success) {this.content = decode(data.data)}}},computed: {listenChange() {const {fileId, filePath} = thisreturn {fileId, filePath}},},watch: {listenChange() {this.getXml()}}
}
</script>
<style scoped>
</style>

3、引用组件

<ace v-else-if="fileType==='xmlType'" style="height: 100%;width: 100%":fileId="`${currentNode.data}`" :filePath="`${currentNode.id}`"/>

或者

<ace :data="data"/>

vue 使用ace编辑器相关推荐

  1. ACE编辑器ace-editor笔记

    <template><div class="ace-editor" ref="ace"></div> </templa ...

  2. html ace编辑器,Springboot 集成 Ace editor前端编辑器

    一.引入Ace editor 本质上Ace editor只是一个js而已.而该js引用了其他js(如扩展.主题等js),因此将ace editor.js引入项目时最好复制整个文件夹,不能只复制一个ac ...

  3. Vue 富文本编辑器插件 vue-quill-editor 坑!

    Vue3 + vue-quill-editor 安装步骤: vue3 安装vue-quill-editor npm install @vueup/vue-quill vue2 安装vue-quill- ...

  4. Vue引入 mavon-editor 编辑器的详细步骤

    Vue引入 mavon-editor 编辑器的详细步骤 一.编辑器的引入 如果你的项目之前没有安装过该编辑器,那就得先安装编辑器 在自己的项目的根目录执行下列命令: npm install mavon ...

  5. 技能学习:学习使用php(tp6框架) + vue.js,开发前端全栈网站-8.使用mavoneditor(vue的markdown编辑器),并批量上传图片

    技能学习:学习使用php(tp6框架) + vue.js,开发前端全栈网站-8.使用mavoneditor(vue的markdown编辑器),并批量上传图片 技能学习:学习使用php(tp6框架) + ...

  6. # Vue 中 JSON 编辑器使用

    Vue 中 JSON 编辑器使用 文章目录 Vue 中 JSON 编辑器使用 背景描述 vue-json-edit 安装依赖 测试页面 效果图 bin-code-editor 安装依赖 测试页面 效果 ...

  7. vue中使用图像编辑器tui-image-editor(一)

    vue中使用图像编辑器tui-image-editor(一) 场景:需要对图片进行旋转.缩放.裁剪.涂鸦.标注.添加文本等. 效果-图1 1.基本介绍 官网:https://ui.toast.com/ ...

  8. vue中使用图像编辑器tui-image-editor(二)——应用示例

    vue中使用图像编辑器tui-image-editor(二)--应用示例 效果 代码 mark.vue <template><div class="drawing-cont ...

  9. Vue中富文本编辑器的使用

    基于 Vue 的富文本编辑器有很多,例如官方就收录推荐了一些: https://github.com/vuejs/awesome-vue#rich-text-editing . 这里我们以 eleme ...

  10. html ace编辑器,Tiny-editor

    Tiny-editor是和jsFiddle一样具有在线运行js功能的在线代码编辑器,基于Ace. Usage 1.下载slidePage git clone https://github.com/li ...

最新文章

  1. linux receive函数,Linux网络 - 数据包的接收过程
  2. java集合类详解和使用_Java 集合类详解
  3. 开了gomod不识别gopath_笔记本电脑开不了机原因 笔记本电脑开不了机解决方法【图文】...
  4. ExtJs常用数据源store
  5. 别把紧张情绪带回家 下班后的10个最佳放松法
  6. 麻省理工 城市规划 计算机,麻省理工学院建筑设计与城市规划科研
  7. Ghost xp NetMeeting不能共享桌面的解决办法
  8. 二元线性方程组与二阶行列式
  9. Web开发之分页功能
  10. 来自GitHub的Python开源项目,100%可用的12306多功能抢票助手,切勿作为商业用途
  11. win10商店下载主题壁纸提取
  12. 产品生命周期用户生命周期?
  13. 什么是勒索病毒?有哪些危害?如何预防?
  14. 【keepass】密码管理软件-推荐插件和相关工具合集-keepass工作流分析(自动填充、美化界面、快速添加记录、安全增强、软件和数据库维护类)
  15. 空中群体机器人研究综述
  16. 疲劳驾驶样本集_上海6辆集卡车追尾起火,集卡事故为何频发? | 港口圈
  17. 计算机能够运行的程序的大小不能超过内存,内存大小是影响电脑中运行的程序的速度...
  18. 简单双机通信java_完整版)51单片机实现双机通信(自己整理的
  19. iOS_OC_UIStackView属性和方法讲解
  20. 华为手机备忘录怎么打开

热门文章

  1. 获取计算机登录用户名和密码,查看电脑的登录用户名_查看电脑用户名和密码...
  2. 计算机发展的新技术,计算机新技术发展的有关论文
  3. python面板数据模型操作步骤_面板模型回归操作指南,适合初学者!
  4. C# WinForm开发鼠标连点器
  5. Mac下安装Eclipse
  6. 利用kali Linux破解WiFi密码
  7. WIN7 VS2005 安装wince6.0教程(不管是X86还是X64,我都尝试成功了)
  8. 规范使用地图,从规范制图开始
  9. python 类的执行中保部存值_VisualFoxPro的报表文件.FRX中保存的是______。
  10. PMP工具与技术总结