https://github.com/gera2ld/vue-code
DEPRECATED in favor of vueleton
https://github.com/gera2ld/vue-code
Last synced: 5 months ago
JSON representation
DEPRECATED in favor of vueleton
- Host: GitHub
- URL: https://github.com/gera2ld/vue-code
- Owner: gera2ld
- Created: 2016-10-16T03:29:49.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2017-08-19T13:21:00.000Z (almost 9 years ago)
- Last Synced: 2025-08-09T18:44:17.333Z (12 months ago)
- Language: JavaScript
- Homepage:
- Size: 35.2 KB
- Stars: 7
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
vue-code
===



### This package is deprecated in favor of [vueleton](https://github.com/gera2ld/vueleton).
A code editor based on Vue.js and CodeMirror.
Installation
---
``` sh
$ npm i vue-code
```
Usage
---
``` html
```
``` js
import Vue from 'vue';
import VueCode from 'vue-code';
// require additional CodeMirror files
import 'codemirror/lib/codemirror.css';
import 'codemirror/mode/javascript/javascript';
new Vue({
el: '#my-selector',
components: {
VueCode,
},
data: {
code: 'console.log("hello, world");',
options: {
mode: 'javascript',
},
},
methods: {
onReady(cm) {
console.log('Oh, you got the CodeMirror instance:', cm);
},
},
});
```
For more detailed usage, please see [demo](demo).
Document
---
Content is passed to the component by `v-model`.
* Props:
* `options`
An object to be passed directly to CodeMirror.
* Events:
* `ready`
Emitted when CodeMirror instance is ready and passed as the only argument.
Snapshots
---
