# code-editor

[![vue](https://img.shields.io/badge/MADE%20WITH-VUE-42a97a?style=for-the-badge&labelColor=35495d)](https://vuejs.org)

[![npm](https://img.shields.io/npm/v/vue-codemirror?color=c7343a&label=npm&style=for-the-badge)](https://www.npmjs.com/package/@wcfdehao/code-editor)

[![license](https://img.shields.io/github/license/mashape/apistatus.svg?style=for-the-badge)](/LICENSE)

[CodeMirror(6)](https://codemirror.net) component for Vue(3).

### Usage

#### Install

```bash
npm install @wcfdehao/code-editor
```

## local component

```vue
<template>
  <code-editor
    v-model="code"
    language="javascript"
    :dark="true"
  />
</template>

<script>
  import { codeEditor } from '@wcfdehao/code-editor'

  export default {
    components: {
      Codemirror
    },
    setup() {
      const code = ref(`console.log('Hello, world!')`)

      return {
        code
      }
    }
  }
</script>
```



## Project setup
```
npm install
```

### Compiles and hot-reloads for development
```
npm run serve
```

### Compiles and minifies for production
```
npm run build
```

### Run your unit tests
```
npm run test:unit
```

### Customize configuration
See [Configuration Reference](https://cli.vuejs.org/config/).
