# vue2-ace-editor2

> A Vue2.0's component based on ace/brace

Latest version **0.0.27** (published 2019-06-30) · MIT license · 0 weekly downloads

## Install

```sh
npm install vue2-ace-editor2
pnpm add vue2-ace-editor2
yarn add vue2-ace-editor2
bun add vue2-ace-editor2
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.27 |
| Published | 2019-06-30 |
| First published | 2019-06-30 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 16.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | collerek |
| Maintainers | collerek |

## Links

- npm: https://www.npmjs.com/package/vue2-ace-editor2
- Repository: https://github.com/collerek/vue2-ace-editor
- Homepage: https://github.com/collerek/vue2-ace-editor/#readme
- Issues: https://github.com/collerek/vue2-ace-editor/issues
- npm.io page: https://npm.io/package/vue2-ace-editor2

## Dependencies (1)

- [brace](https://npm.io/package/brace.md) ^0.11.0

## Recent versions

- 0.0.27 (latest) — 2019-06-30
- 0.0.26 — 2019-06-30
- 0.0.25 — 2019-06-30
- 0.0.24 — 2019-06-30
- 0.0.23 — 2019-06-30
- 0.0.22 — 2019-06-30
- 0.0.21 — 2019-06-30
- 0.0.20 — 2019-06-30
- 0.0.19 — 2019-06-30
- 0.0.18 — 2019-06-30
- 0.0.17 — 2019-06-30
- 0.0.16 — 2019-06-30
- 0.0.15 — 2019-06-30
- 0.0.14 — 2019-06-30
- 0.0.13 — 2019-06-30

## README

vue2-ace-editor
====================


[![npm](https://img.shields.io/npm/v/vue2-ace-editor2.svg)](https://www.npmjs.com/package/vue2-ace-editor2)


A packaging of [ace](https://ace.c9.io/)


```js
require(['emmet/emmet'],function (data) { // this is huge. so require it async is better
    window.emmet = data.emmet;
});
```

## How to use

1. Install

    ```
    npm install --save-dev vue2-ace-editor
    ```
    
2. Require it in `components` of Vue options

    ```js
    {
        data,
        methods,
        ...
        components: {
            editor: require('vue2-ace-editor'),
        },
    }
    ```
 
3. Require the editor's mode/theme module in custom methods
    
    ```js
    {
        data,
        methods: {
            editorInit: function () {
                require('brace/ext/language_tools') //language extension prerequsite...
                require('brace/mode/html')                
                require('brace/mode/javascript')    //language
                require('brace/mode/less')
                require('brace/theme/chrome')
                require('brace/snippets/javascript') //snippet
            }
        },
    }
    ```
    
4. Use the component in template

    ```html
    <editor v-model="content" @init="editorInit" lang="html" theme="chrome" width="500" height="100"></editor>
    ```
    
    prop `v-model`  is required
    
    prop `lang` and `theme` is same as [ace-editor's doc](https://github.com/ajaxorg/ace)
    
    prop `height` and `width` could be one of these:  `200`, `200px`, `50%`
    
5. Access the ACE's instance

    `<editor ref='myEditor'>`

    `let editor = this.$refs.myEditor.editor`
    
    or
    
    ```
    editorInit: function (editor) {
    
    }
    ```

---
_Source: https://npm.io/package/vue2-ace-editor2 · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
