npm:https://www.npmjs.com/package/vue-codemirror
npm install vue-codemirror --save
main.js
import Vue from ‘vue‘ import VueCodemirror from ‘vue-codemirror‘ // require styles import ‘codemirror/lib/codemirror.css‘ // require more codemirror resource... // you can set default global options and events when use Vue.use(VueCodemirror, /* { options: { theme: ‘base16-dark‘, ... }, events: [‘scroll‘, ...] } */)
component.vue
// require component import { codemirror } from ‘vue-codemirror‘ // require styles import ‘codemirror/lib/codemirror.css‘ // require more codemirror resource... // component export default { components: { codemirror } }
记录。