All Projects → sireniaeu → vue2-codemirror-lite-js

sireniaeu / vue2-codemirror-lite-js

Licence: other
🎩 Lightweight CodeMirror component for Vue.js 2.x (JS only with linting via JSHINT)

Programming Languages

Vue
7211 projects
javascript
184084 projects - #8 most used programming language
CSS
56736 projects

Projects that are alternatives of or similar to vue2-codemirror-lite-js

Vue Element Loading
⏳ Loading inside a container or full screen for Vue.js
Stars: ✭ 234 (+1362.5%)
Mutual labels:  vuejs2
Vue Mapbox Gl
A Vue.js component for Mapbox GL JS
Stars: ✭ 242 (+1412.5%)
Mutual labels:  vuejs2
blog-frontend
Frontend of blog created using: GraphQL (Apollo) + Vue + Nuxt.js + TypeScript + Vuetify...
Stars: ✭ 43 (+168.75%)
Mutual labels:  vuejs2
Monkov
A blog system built with vue and koa
Stars: ✭ 234 (+1362.5%)
Mutual labels:  vuejs2
Pretty Checkbox Vue
Quickly integrate pretty checkbox components with Vue.js
Stars: ✭ 240 (+1400%)
Mutual labels:  vuejs2
Vue Product Zoomer
Zoom Prodct Image, useful for e-shop website
Stars: ✭ 248 (+1450%)
Mutual labels:  vuejs2
Vue2 Scrollbar
The Simplest Pretty Scroll Area Component with custom scrollbar for Vue 2. https://bosnaufal.github.io/vue2-scrollbar
Stars: ✭ 233 (+1356.25%)
Mutual labels:  vuejs2
dynamoc
A DynamoDB GUI client https://ieiayaobb.github.io/dynamoc/
Stars: ✭ 70 (+337.5%)
Mutual labels:  vuejs2
Vue Tabs
Simplified bootstrap tabs
Stars: ✭ 241 (+1406.25%)
Mutual labels:  vuejs2
Vue Form Json Schema
Create forms using JSON schema. Bring your components!
Stars: ✭ 253 (+1481.25%)
Mutual labels:  vuejs2
Copilot
Responsive Bootstrap 3 Admin Template based on AdminLTE with vue.js
Stars: ✭ 2,698 (+16762.5%)
Mutual labels:  vuejs2
Vue Scroll
Scroll directive on vue
Stars: ✭ 238 (+1387.5%)
Mutual labels:  vuejs2
Vue Cnode
🔥Vue.js打造一个开源的CNode社区。CNode by Vue.js
Stars: ✭ 249 (+1456.25%)
Mutual labels:  vuejs2
Vue Fab
Vue Floating Action Button
Stars: ✭ 233 (+1356.25%)
Mutual labels:  vuejs2
RumahSakitJakarta
🏥 Daftar Rumah Sakit Umum, Khusus dan Puskesmas di Jakarta
Stars: ✭ 23 (+43.75%)
Mutual labels:  vuejs2
Vue Material Kit
Vue Material Kit - Open Source Material Design UI Kit
Stars: ✭ 231 (+1343.75%)
Mutual labels:  vuejs2
Vue Examples
Collection of Vue examples for beginner front end developers
Stars: ✭ 244 (+1425%)
Mutual labels:  vuejs2
remote-pad-gui
Desktop app to start remote pad services to help you get started
Stars: ✭ 17 (+6.25%)
Mutual labels:  vuejs2
vue-filter-date-format
Simple date formatting filter for Vue.js
Stars: ✭ 111 (+593.75%)
Mutual labels:  vuejs2
H5 Editor
📕h5可视化编辑器,支持添加图片/文本/形状等,拥有图层/参考线/标尺/自动吸附对齐等功能
Stars: ✭ 224 (+1300%)
Mutual labels:  vuejs2

Vue2 Codemirror Lite

CodeMirror component for Vue.js 2.x, configured for linting & js mode only to keep it light.

Vue2 Codemirror for JS screenshot

See demo

Motivation

For applications that only use CodeMirror for JavaScript, the bundle size can seriously be decreased by eliminating some of the features, themes and modes.

This is not a fully-featured CodeMirror plugin (that's why it's lite). If you are looking for that, please check out vue-codemirror.

Most things are pre-configured (i.e. mode, theme), but additional CodeMirror options can be set (see Codemirror config APIs).

What's inside

  • JavaScript only mode (not configurable)
  • lint via JSHINT (bundled, not configurable)
  • dark theme only (slightly modified neo, see demo.)
  • line numbers, line wrapping
  • accepts additional CodeMirror options (see some here), except for mode, theme & those that require addons.

Getting started

Installing

npm install vue2-codemirror-lite-js --save # yarn add vue2-codemirror-lite-js

Usage

// Require in Webpack.
var Vue = require('vue')
var CodeMirrorLiteJs = require('vue2-codemirror-lite-js')

Vue.use(CodeMirrorLiteJs)


// Or use as component (ES6)
import Vue from 'vue'
import { codemirror } from 'vue2-codemirror-lite-js'

export default {
  components: {
    codemirror
  }
}

Usage in template

<!-- simple -->
<codemirror :code="code"></codemirror>

<!-- simple (with bindings) -->
<codemirror v-model="code"></codemirror>

<!-- advanced -->
<codemirror
    :code="code"
    :options="{
       tabSize: 2,
       lineNumbers: true,
       lineWrapping: true,
       line: true,
       gutters: ['CodeMirror-linenumbers', 'CodeMirror-lint-markers'],
       lint: true
    }"
    :lintOptions="{
        sub: true,
        notypeof: true
    }"
    @changed="yourCodeChangeMethod">
</codemirror>

Lint options are equivalent to JSHINT options (or what you'd normally put in .jshintrc). See all the options here

There's also a code example available in the source.

Developing

There's a simple webpack config setup to get you started.

Build / watch

npm run build

Run the example

npm run serve

Feel free to contribute to the build config and make it better :)

Contributing

Contributions are welcome for additional options, themes and modes that don't increase the bundle size. Ideally, if you want to contribute split your code.

Changelog

#####v3.0.6

  • Moved to Sireniaeu

#####v3.0.5

  • Added watcher for replaceRange, essentially allowing to replace or insert text at line & ch.

#####v3.0.4

  • Added lint options for jshint (.jshintrc-like)
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].