JSPM

  • Created
  • Published
  • Downloads 90217
  • Score
    100M100P100Q150262F
  • License MIT

Codemirror component for Vue.js

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

Build Setup

# install vue-codemirror
npm install vue-codemirror


# app use
import Vue from 'vue'
...
import CodeMirror from 'vue-codemirror'
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 }'
  }
}

More example

More Codemirror Config

Author Blog

Surmon