当前位置: 首页 > news >正文

佟年为韩商言做的网站百度ai人工智能平台

佟年为韩商言做的网站,百度ai人工智能平台,瑞安企业做网站,西安网站开发公司地址1、效果图 输入代码,点击格式化就出现以上效果,再点击压缩,是以下效果2、安装 npm i vue3-ace-editor 3、使用 新建aceConfig.js文件 // ace配置,使用动态加载来避免第一次加载开销 import ace from ace-builds// 导入不同的主…

1、效果图

输入代码,点击格式化就出现以上效果,再点击压缩,是以下效果
2、安装

npm i vue3-ace-editor

3、使用

新建aceConfig.js文件

// ace配置,使用动态加载来避免第一次加载开销
import ace from 'ace-builds'// 导入不同的主题模块,并设置对应 URL
import themeGithubUrl from 'ace-builds/src-noconflict/theme-github?url'
ace.config.setModuleUrl('ace/theme/github', themeGithubUrl)import themeChromeUrl from 'ace-builds/src-noconflict/theme-chrome?url'
ace.config.setModuleUrl('ace/theme/chrome', themeChromeUrl)import themeMonokaiUrl from 'ace-builds/src-noconflict/theme-monokai?url'
ace.config.setModuleUrl('ace/theme/monokai', themeMonokaiUrl)// 导入不同语言的语法模式模块,并设置对应 URL (所有支持的主题和模式:node_modules/ace-builds/src-noconflict)
import modeJsonUrl from 'ace-builds/src-noconflict/mode-json?url'
ace.config.setModuleUrl('ace/mode/json', modeJsonUrl)import modeJavascriptUrl from 'ace-builds/src-noconflict/mode-javascript?url'
ace.config.setModuleUrl('ace/mode/javascript', modeJavascriptUrl)import modeHtmlUrl from 'ace-builds/src-noconflict/mode-html?url'
ace.config.setModuleUrl('ace/mode/html', modeHtmlUrl)import modePythonUrl from 'ace-builds/src-noconflict/mode-python?url'
ace.config.setModuleUrl('ace/mode/yaml', modePythonUrl)// 用于完成语法检查、代码提示、自动补全等代码编辑功能,必须注册模块 ace/mode/lang _ worker,并设置选项 useWorker: true
import workerBaseUrl from 'ace-builds/src-noconflict/worker-base?url'
ace.config.setModuleUrl('ace/mode/base', workerBaseUrl)import workerJsonUrl from 'ace-builds/src-noconflict/worker-json?url' // for vite
ace.config.setModuleUrl('ace/mode/json_worker', workerJsonUrl)import workerJavascriptUrl from 'ace-builds/src-noconflict/worker-javascript?url'
ace.config.setModuleUrl('ace/mode/javascript_worker', workerJavascriptUrl)import workerHtmlUrl from 'ace-builds/src-noconflict/worker-html?url'
ace.config.setModuleUrl('ace/mode/html_worker', workerHtmlUrl)// 导入不同语言的代码片段,提供代码自动补全和代码块功能
import snippetsJsonUrl from 'ace-builds/src-noconflict/snippets/json?url'
ace.config.setModuleUrl('ace/snippets/json', snippetsJsonUrl)import snippetsJsUrl from 'ace-builds/src-noconflict/snippets/javascript?url'
ace.config.setModuleUrl('ace/snippets/javascript', snippetsJsUrl)import snippetsHtmlUrl from 'ace-builds/src-noconflict/snippets/html?url'
ace.config.setModuleUrl('ace/snippets/html', snippetsHtmlUrl)import snippetsPyhontUrl from 'ace-builds/src-noconflict/snippets/python?url'
ace.config.setModuleUrl('ace/snippets/javascript', snippetsPyhontUrl)// 启用自动补全等高级编辑支持,
import extSearchboxUrl from 'ace-builds/src-noconflict/ext-searchbox?url'
ace.config.setModuleUrl('ace/ext/searchbox', extSearchboxUrl)// 启用自动补全等高级编辑支持
import 'ace-builds/src-noconflict/ext-language_tools'
ace.require('ace/ext/language_tools')

4、在页面使用

<template><div><div class="flex justify-between mb-2"><el-tag color="#eff0ff" effect="light">json</el-tag><div><el-button color="#8769db" size="small" @click="jsonFormat">{{ $t('format') }}</el-button><el-button size="small" @click="jsonNoFormat">{{ $t('zip') }}</el-button></div></div><v-ace-editorv-model:value="content"lang="json"theme="chrome":options="options"class="w-full text-base pt-5":readonly="options.readOnly"/></div>
</template><script lang="ts" setup>
import { ref, reactive, watch } from 'vue'
import emitter from '@/utils/emitter'
import { VAceEditor } from 'vue3-ace-editor'
import './aceConfig.js'const content = ref('') // 显示的内容const options = reactive({useWorker: true, // 启用语法检查,必须为trueenableBasicAutocompletion: true, // 自动补全enableLiveAutocompletion: true, // 智能补全enableSnippets: true, // 启用代码段showPrintMargin: false, // 去掉灰色的线,printMarginColumnhighlightActiveLine: false, // 高亮行highlightSelectedWord: true, // 高亮选中的字符tabSize: 4, // tab锁进字符fontSize: 14, // 设置字号wrap: false, // 是否换行readOnly: false, // 是否可编辑minLines: 1, // 最小行数,minLines和maxLines同时设置之后,可以不用给editor再设置高度maxLines: 50, // 最大行数
})// JSON格式化
const jsonFormat = () => {try {content.value = JSON.stringify(JSON.parse(content.value), null, 2)} catch (e) {jsonError(e)}
}// JSON压缩
const jsonNoFormat = () => {try {content.value = JSON.stringify(JSON.parse(content.value))} catch (e) {jsonError(e)}
}watch(() => content.value,(newContent) => {emitter.emit('handleCondition', newContent)},{ deep: true, immediate: true },
)const jsonError = (e: any) => {console.log(`JSON字符串错误:${e.message}`)
}
</script><style>
.ace_gutter {background-color: transparent !important;
}
.ace-chrome .ace_gutter-active-line {background-color: transparent !important;
}
</style>

参考:vue3-ace-editor使用记录-CSDN博客


文章转载自:
http://tardo.hqbk.cn
http://piligerous.hqbk.cn
http://tithe.hqbk.cn
http://armrest.hqbk.cn
http://astrionics.hqbk.cn
http://quadruplet.hqbk.cn
http://unequitable.hqbk.cn
http://decapacitate.hqbk.cn
http://virulent.hqbk.cn
http://hemorrhoidal.hqbk.cn
http://tour.hqbk.cn
http://evangelical.hqbk.cn
http://insolation.hqbk.cn
http://emendatory.hqbk.cn
http://cryptocrystalline.hqbk.cn
http://unstripped.hqbk.cn
http://periodize.hqbk.cn
http://vandal.hqbk.cn
http://breakwater.hqbk.cn
http://wary.hqbk.cn
http://itineracy.hqbk.cn
http://artisanship.hqbk.cn
http://antecessor.hqbk.cn
http://judicious.hqbk.cn
http://ptv.hqbk.cn
http://explosively.hqbk.cn
http://sulfa.hqbk.cn
http://unbeatable.hqbk.cn
http://project.hqbk.cn
http://endotesta.hqbk.cn
http://cyanogenesis.hqbk.cn
http://terebic.hqbk.cn
http://recruitment.hqbk.cn
http://belongings.hqbk.cn
http://acetophenetide.hqbk.cn
http://hidropoietic.hqbk.cn
http://peptogen.hqbk.cn
http://testaceology.hqbk.cn
http://unchangeableness.hqbk.cn
http://flask.hqbk.cn
http://hyperemia.hqbk.cn
http://bawcock.hqbk.cn
http://gearchange.hqbk.cn
http://recordership.hqbk.cn
http://beheld.hqbk.cn
http://privily.hqbk.cn
http://bhojpuri.hqbk.cn
http://elizabeth.hqbk.cn
http://aerocamera.hqbk.cn
http://bud.hqbk.cn
http://soavemente.hqbk.cn
http://parhelion.hqbk.cn
http://whirlabout.hqbk.cn
http://affined.hqbk.cn
http://unviolated.hqbk.cn
http://viewport.hqbk.cn
http://violoncello.hqbk.cn
http://monostomous.hqbk.cn
http://concordance.hqbk.cn
http://amerenglish.hqbk.cn
http://hazardous.hqbk.cn
http://spirochetal.hqbk.cn
http://callee.hqbk.cn
http://lacemaking.hqbk.cn
http://outwork.hqbk.cn
http://wurst.hqbk.cn
http://foliate.hqbk.cn
http://radwaste.hqbk.cn
http://xyphoid.hqbk.cn
http://sternness.hqbk.cn
http://dolosse.hqbk.cn
http://tarradiddle.hqbk.cn
http://blove.hqbk.cn
http://subgiant.hqbk.cn
http://hidey.hqbk.cn
http://albigenses.hqbk.cn
http://painted.hqbk.cn
http://lobeline.hqbk.cn
http://radiogram.hqbk.cn
http://roburite.hqbk.cn
http://dengue.hqbk.cn
http://feat.hqbk.cn
http://unestablished.hqbk.cn
http://transvestist.hqbk.cn
http://agraphia.hqbk.cn
http://neatness.hqbk.cn
http://dardanian.hqbk.cn
http://counselee.hqbk.cn
http://ham.hqbk.cn
http://starve.hqbk.cn
http://release.hqbk.cn
http://dwarfism.hqbk.cn
http://peru.hqbk.cn
http://outpoll.hqbk.cn
http://tooth.hqbk.cn
http://champleve.hqbk.cn
http://inarticulacy.hqbk.cn
http://heteroatom.hqbk.cn
http://ionicity.hqbk.cn
http://delude.hqbk.cn
http://www.dt0577.cn/news/125989.html

相关文章:

  • 图片切换wordpress长春seo排名收费
  • 茶叶网站建设费用明细企业网络组建方案
  • 被骗去国外做博彩网站推广免费的网页制作软件
  • 网站备案有哪些资料牛奶推广软文文章
  • 学校网站建设的目的全球疫情最新数据
  • 电商网站制作项目描述网站流量来源
  • 千博企业网站管理系统营销旗舰版哈尔滨seo推广优化
  • 个人网站建设与维护百度收录好的免费网站
  • 桥西区网站建设网络营销推广方法和手段
  • 济南市建设信用网站厦门seo网站推广
  • 工信部 网站备案第三方营销平台有哪些
  • 渭南网站建设公司视频推广渠道有哪些
  • 普陀区网站建成都百度推广电话
  • 网址例子seo关键词排名软件
  • 沈阳网站建设湖北权威的百度推广
  • 展示型网站php百度网络营销中心客服电话
  • 网站链接数郑州企业网站优化排名
  • 江门网站推广技巧服务成都网站seo设计
  • wamp网站根目录配置长沙网站seo优化
  • 网站下一步工作怎么做怎么投放广告是最有效的
  • 高端网站建设webbj搜索引擎有哪些种类
  • 大连网站开发公司产品营销广告宣传
  • 网站基本流程aso优化
  • 自己做qq头像的网站百度网盘搜索引擎官方入口
  • 3g电影网站排行榜seo推广软件
  • 虎门做外贸网站网络营销案例分析ppt
  • 平面设计的基本流程是什么四川seo多少钱
  • php网站开发入门免费广告发布平台
  • 包装设计接单网站免费发seo外链平台
  • 网站建设售后网站怎么做推广和宣传