vue2.7-ace-editor
v2.2.7
Published
Like vue2-ace-editor but more functional and supports Vue 2.7 && vite
Downloads
312
Readme
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:[email protected]",
"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