vue2.7-ace-editor
A packaging of ace. fork from vue3-ace-editor
- support vue 2.7
- support vite
Install
pnpm add vue2.7-ace-editor ace-builds
Use alias
"dependencies": {
"vue-ace-editor": "npm:vue2.7-ace-editor@2.2.5",
"ace-builds": "latest"
}
Import
<template>
<editor v-bind="$attrs" v-on="$listeners" :value="value" />
</template>
<script lang="ts">
/**
* 封装ace-editor
*/
import { PropType, computed, defineComponent, reactive, ref, toRef, toRefs, watch } from 'vue'
import { VAceEditor } from 'vue-ace-editor'
import 'ace-builds/src-noconflict/mode-json'
import 'ace-builds/src-noconflict/mode-html'
import 'ace-builds/src-noconflict/mode-xml'
import 'ace-builds/src-noconflict/mode-javascript'
import 'ace-builds/src-noconflict/mode-python'
import 'ace-builds/src-noconflict/mode-less'
import 'ace-builds/src-noconflict/mode-groovy'
import 'ace-builds/src-noconflict/theme-chrome'
export default defineComponent({
name: 'ace-editor',
components: { editor: VAceEditor },
props: {
value: { default: '', type: String },
}
})
</script>
LICENSE
MIT