# libj-vue-comp-code-editing
### Part of libj tools

CodeMirror.js wrapper for vue

__Needs jQuery and Vue to be available globally__

## Usage
```
npm install libj-vue-comp-code-editing
```

## j-code-editor
### props
- __value (String) | default: ''__ html or js or css code
- __canCopy (Boolean) | default: true__ can user copy the code using a button or not
- __visible (Boolean) | default: false__ visibility of component
### methods
- __getHtml() => String__ returns current html
- __setHtml(html)__ sets current html

## With default theme
```
import 'libj-vue-comp-code-editing/dist/libj-vue-comp-code-editing.default.min.css'
import 'libj-vue-comp-code-editing'
//Now, j-code-editor is available globally
```

## Customize theme
You'll need a separate .scss file
```
// Set variables here
.
.
.
@import 'libj-vue-comp-code-editing/index.scss';
// Now override classes
.
.
.
```

### SCSS Variables:
```
$j-code-editor-height: 400px !default;
```

## Test
- Run this in a separate command line to start node server
```
node server.js
```
- Run one of the following to re-create bundles
```
npm run dev
npm run dev:watch
```
- Navigate to http://localhost:3000

## Build
```
npm run build
npm run build:watch
```