Package Exports
- vue-codemirror
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (vue-codemirror) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
vue-codemirror
Codemirror components for Vue.js
Screenshots


Build Setup
# install vue-codemirror
npm install vue-codemirror
# Vue use
## import with ES6
import Vue from 'vue'
...
import CodeMirror from 'vue-codemirror'
## require with Webpack
var Vue = require('vue')
...
var CodeMirror = require('vue-codemirror')
## use
Vue.use(CodeMirror)
# use in components
<codemirror></codemirror>
# component data bind
<codemirror :code.sync="code"></codemirror>
# component config example 1
<codemirror :code.sync="code" :options="editorOption"></codemirror>
data () {
return {
code: 'const a = 10',
editorOption: {
tabSize: 4,
mode: 'javascript',
theme: 'base16-dark',
lineNumbers: true,
line: true,
...
}
}
}
# component config example 2
<codemirror :code.sync="css" :options="{ tabSize: 2, mode: 'css' }"></codemirror>
data () {
return {
css: '.class { display: block }'
}
}