Installations
npm install vue2-brace-editor
Developer Guide
Typescript
No
Module System
CommonJS
Node Version
8.11.4
NPM Version
6.4.1
Score
71.1
Supply Chain
98.6
Quality
74.9
Maintenance
100
Vulnerability
100
License
Releases
Unable to fetch releases
Contributors
Unable to fetch Contributors
Languages
Vue (84.15%)
JavaScript (15.85%)
Love this project? Help keep it running — sponsor us today! 🚀
Developer
Hector101
Download Statistics
Total Downloads
165,244
Last Day
107
Last Week
603
Last Month
2,357
Last Year
31,076
GitHub Statistics
MIT License
15 Stars
16 Commits
7 Forks
2 Watchers
1 Branches
2 Contributors
Updated on Nov 18, 2022
Bundle Size
430.65 kB
Minified
120.78 kB
Minified + Gzipped
Package Meta Information
Latest Version
2.0.2
Package Id
vue2-brace-editor@2.0.2
Unpacked Size
647.57 kB
Size
177.97 kB
File Count
16
NPM Version
6.4.1
Node Version
8.11.4
Total Downloads
Cumulative downloads
Total Downloads
165,244
Last Day
-13.7%
107
Compared to previous day
Last Week
6.7%
603
Compared to previous week
Last Month
42.8%
2,357
Compared to previous month
Last Year
8.3%
31,076
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Vue2-Brace-Editor
A Vue components for Ace / Brace
Install
npm install vue2-brace-editor
Basic Usage
1 2<template> 3 // Full editor component 4 <AceEditor 5 :fontSize="14" 6 :showPrintMargin="true" 7 :showGutter="true" 8 :highlightActiveLine="true" 9 mode="javascript" 10 theme="monokai" 11 :onChange="onChange" 12 name="editor" 13 :editorProps="{$blockScrolling: true}" 14 /> 15 16 // Split editor component 17 <SplitEditor 18 mode="javascript" 19 theme="monokai" 20 :splits="2" 21 orientation="beside" 22 name="editor" 23 :editorProps="{$blockScrolling: true}" 24 /> 25</template> 26 27<script> 28 import Vue from 'vue'; 29 import brace from 'brace'; 30 import { Ace as AceEditor, Split as SplitEditor } from 'vue2-brace-editor'; 31 32 import 'brace/mode/javascript'; 33 import 'brace/theme/monokai'; 34 35 export default { 36 components: { 37 AceEditor, 38 SplitEditor, 39 }, 40 $el: 'root', 41 methods: { 42 onChange(newValue) { 43 console.log('change',newValue); 44 } 45 } 46 } 47</script> 48
Ace Editor - Full
This is the main component of Vue2-brace. It creates an instance of the Ace Editor.
Available Props
Prop | Default | Type | Description |
---|---|---|---|
name | 'brace-editor' | String | Unique Id to be used for the editor |
mode | '' | String | Language for parsing and code highlighting |
theme | '' | String | theme to use |
value | '' | String | value you want to populate in the code highlighter |
defaultValue | '' | String | Default value of the editor |
height | '500px' | String | CSS value for height |
width | '500px' | String | CSS value for width |
className | String | custom className | |
fontSize | 12 | Number | pixel value for font-size |
showGutter | true | Boolean | show gutter |
showPrintMargin | true | Boolean | show print margin |
highlightActiveLine | true | Boolean | highlight active line |
focus | false | Boolean | whether to focus |
cursorStart | 1 | Number | the location of the cursor |
wrapEnabled | false | Boolean | Wrapping lines |
readOnly | false | Boolean | make the editor read only |
minLines | Number | Minimum number of lines to be displayed | |
maxLines | Number | Maximum number of lines to be displayed | |
enableBasicAutocompletion | false | Boolean | Enable basic autocompletion |
enableLiveAutocompletion | false | Boolean | Enable live autocompletion |
tabSize | 4 | Number | tabSize |
debounceChangePeriod | null | Number | A debounce delay period for the onChange event |
onLoad | Function | called on editor load. The first argument is the instance of the editor | |
onBeforeLoad | Function | called before editor load. the first argument is an instance of ace | |
onChange | Function | occurs on document change it has 2 arguments the value and the event. | |
onCopy | Function | triggered by editor copy event, and passes text as argument | |
onPaste | Function | Triggered by editor paste event, and passes text as argument | |
onSelectionChange | Function | triggered by editor selectionChange event, and passes a Selection as it's first argument and the event as the second | |
onCursorChange | Function | triggered by editor changeCursor event, and passes a Selection as it's first argument and the event as the second | |
onFocus | Function | triggered by editor focus event | |
onBlur | Function | triggered by editor blur event.It has two arguments event and editor | |
onInput | Function | triggered by editor input event | |
onScroll | Function | triggered by editor scroll event | |
onValidate | Function | triggered, when annotations are changed | |
editorProps | Object | properties to apply directly to the Ace editor instance | |
setOptions | Object | options to apply directly to the Ace editor instance | |
keyboardHandler | String | corresponding to the keybinding mode to set (such as vim or emacs) | |
commands | Array | new commands to add to the editor | |
annotations | Array | annotations to show in the editor i.e. [{ row: 0, column: 2, type: 'error', text: 'Some error.'}] , displayed in the gutter | |
markers | Array | markers to show in the editor, i.e. [{ startRow: 0, startCol: 2, endRow: 1, endCol: 20, className: 'error-marker', type: 'background' }] | |
style | Object | camelCased properties |
Split Editor
This allows for a split editor which can create multiple linked instances of the Ace editor. Each instance shares a theme and other properties while having their own value.
Available Props
Prop | Default | Type | Description |
---|---|---|---|
name | 'brace-editor' | String | Unique Id to be used for the editor |
mode | '' | String | Language for parsing and code highlighting |
splits | 2 | Number | Number of views to have |
orientation | 'beside' | String | The orientation of the splits either beside or below |
theme | '' | String | theme to use |
value | '' | Array of Strings | value you want to populate in each code editor |
defaultValue | '' | Array of Strings | Default value for each editor |
height | '500px' | String | CSS value for height |
width | '500px' | String | CSS value for width |
className | String | custom className | |
fontSize | 12 | Number | pixel value for font-size |
showGutter | true | Boolean | show gutter |
showPrintMargin | true | Boolean | show print margin |
highlightActiveLine | true | Boolean | highlight active line |
focus | false | Boolean | whether to focus |
cursorStart | 1 | Number | the location of the cursor |
wrapEnabled | false | Boolean | Wrapping lines |
readOnly | false | Boolean | make the editor read only |
minLines | Number | Minimum number of lines to be displayed | |
maxLines | Number | Maximum number of lines to be displayed | |
enableBasicAutocompletion | false | Boolean | Enable basic autocompletion |
enableLiveAutocompletion | false | Boolean | Enable live autocompletion |
tabSize | 4 | Number | tabSize |
onLoad | Function | called on editor load. The first argument is the instance of the editor | |
onBeforeLoad | Function | called before editor load. the first argument is an instance of ace | |
onChange | Function | occurs on document change it has 2 arguments the value of each editor and the event. | |
onCopy | Function | triggered by editor copy event, and passes text as argument | |
onPaste | Function | Triggered by editor paste event, and passes text as argument | |
onSelectionChange | Function | triggered by editor selectionChange event, and passes a Selection as it's first argument and the event as the second | |
onCursorChange | Function | triggered by editor changeCursor event, and passes a Selection as it's first argument and the event as the second | |
onFocus | Function | triggered by editor focus event | |
onBlur | Function | triggered by editor blur event | |
onInput | Function | triggered by editor input event | |
onScroll | Function | triggered by editor scroll event | |
editorProps | Object | properties to apply directly to the Ace editor instance | |
setOptions | Object | options to apply directly to the Ace editor instance | |
keyboardHandler | String | corresponding to the keybinding mode to set (such as vim or emacs) | |
commands | Array | new commands to add to the editor | |
annotations | Array of Arrays | annotations to show in the editor i.e. [{ row: 0, column: 2, type: 'error', text: 'Some error.'}] , displayed in the gutter | |
markers | Array of Arrays | markers to show in the editor, i.e. [{ startRow: 0, startCol: 2, endRow: 1, endCol: 20, className: 'error-marker', type: 'background' }] | |
style | Object | camelCased properties |
How to contribute
To contribute, fork this repo to your private repository and create a pull request based on the feature you want to add. However ensure to follow the AirBnB coding style guide.
Disclaimer
This app and its functions are limited by time constraint and is in no way at its best.
FAQ
- Can I fork this repository?
- Yes you can.
- Can I contribute to the project?
- Yes you can, however it is advised you follow the AirBnB style guide for your PR to be considered being merged to the project
- Can I modify the project, for usage?
- This project is an open source project, so you can.
Dependencies
- brace - browserify compatible version of the ace editor.
Authors
Hector Johnson - github.com/hector101
License
(The MIT License)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
- Info: project has a license file: LICENSE:0
- Info: FSF or OSI recognized license: MIT License: LICENSE:0
Reason
Found 1/15 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'master'
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 2 are checked with a SAST tool
Reason
112 existing vulnerabilities detected
Details
- Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92
- Warn: Project is vulnerable to: GHSA-v88g-cgmw-v5xw
- Warn: Project is vulnerable to: GHSA-whgm-jr23-g3j9
- Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw
- Warn: Project is vulnerable to: GHSA-fwr7-v2mv-hh25
- Warn: Project is vulnerable to: GHSA-8w4h-3cm3-2pm2
- Warn: Project is vulnerable to: GHSA-qwcr-r2fm-qrc7
- Warn: Project is vulnerable to: GHSA-cwfw-4gq5-mrqx
- Warn: Project is vulnerable to: GHSA-g95f-p29q-9xw4
- Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg
- Warn: Project is vulnerable to: GHSA-x9w5-v3q2-3rhw
- Warn: Project is vulnerable to: GHSA-c6rq-rjc2-86v2
- Warn: Project is vulnerable to: GHSA-pxg6-pf52-xh8x
- Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275
- Warn: Project is vulnerable to: GHSA-w573-4hg7-7wgq
- Warn: Project is vulnerable to: GHSA-hr2v-3952-633q
- Warn: Project is vulnerable to: GHSA-3wcq-x3mq-6r9p
- Warn: Project is vulnerable to: GHSA-vh7m-p724-62c2
- Warn: Project is vulnerable to: GHSA-r9p9-mrjm-926w
- Warn: Project is vulnerable to: GHSA-434g-2637-qmqr
- Warn: Project is vulnerable to: GHSA-49q7-c7j4-3p7m
- Warn: Project is vulnerable to: GHSA-977x-g7h5-7qgw
- Warn: Project is vulnerable to: GHSA-f7q4-pwc6-w24p
- Warn: Project is vulnerable to: GHSA-fc9h-whq2-v747
- Warn: Project is vulnerable to: GHSA-4gmj-3p3h-gm8h
- Warn: Project is vulnerable to: GHSA-6h5x-7c5m-7cr7
- Warn: Project is vulnerable to: GHSA-rv95-896h-c2vc
- Warn: Project is vulnerable to: GHSA-qw6h-vgh9-j6wx
- Warn: Project is vulnerable to: GHSA-qrmc-fj45-qfc2
- Warn: Project is vulnerable to: GHSA-8r6j-v8pm-fqw3
- Warn: Project is vulnerable to: MAL-2023-462
- Warn: Project is vulnerable to: GHSA-xf7w-r453-m56c
- Warn: Project is vulnerable to: GHSA-44pw-h2cw-w3vq
- Warn: Project is vulnerable to: GHSA-jp4x-w63m-7wgm
- Warn: Project is vulnerable to: GHSA-c429-5p7v-vgjp
- Warn: Project is vulnerable to: GHSA-43f8-2h32-f4cj
- Warn: Project is vulnerable to: GHSA-6x33-pw7p-hmpq
- Warn: Project is vulnerable to: GHSA-c7qv-q95q-8v27
- Warn: Project is vulnerable to: GHSA-qqgx-2p2h-9c37
- Warn: Project is vulnerable to: GHSA-78xj-cgh5-2h22
- Warn: Project is vulnerable to: GHSA-2p57-rm9w-gvfp
- Warn: Project is vulnerable to: GHSA-2pr6-76vf-7546
- Warn: Project is vulnerable to: GHSA-8j8c-7jfh-h6hx
- Warn: Project is vulnerable to: GHSA-896r-f27r-55mw
- Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h
- Warn: Project is vulnerable to: GHSA-6c8f-qphg-qjgp
- Warn: Project is vulnerable to: GHSA-76p3-8jx3-jpfq
- Warn: Project is vulnerable to: GHSA-3rfm-jhwj-7488
- Warn: Project is vulnerable to: GHSA-hhq3-ff78-jv3g
- Warn: Project is vulnerable to: GHSA-4xc9-xhrj-v574
- Warn: Project is vulnerable to: GHSA-x5rq-j2xg-h7qm
- Warn: Project is vulnerable to: GHSA-jf85-cpcp-j695
- Warn: Project is vulnerable to: GHSA-p6mc-m468-83gw
- Warn: Project is vulnerable to: GHSA-29mw-wpgm-hmr9
- Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm
- Warn: Project is vulnerable to: GHSA-4xcv-9jjx-gfj3
- Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv
- Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3
- Warn: Project is vulnerable to: GHSA-vh95-rmgr-6w4m
- Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h
- Warn: Project is vulnerable to: GHSA-fhjf-83wg-r2j9
- Warn: Project is vulnerable to: GHSA-92xj-mqp7-vmcj
- Warn: Project is vulnerable to: GHSA-wxgw-qj99-44c2
- Warn: Project is vulnerable to: GHSA-5rrq-pxf6-6jx5
- Warn: Project is vulnerable to: GHSA-8fr3-hfg3-gpgp
- Warn: Project is vulnerable to: GHSA-gf8q-jrpm-jvxq
- Warn: Project is vulnerable to: GHSA-2r2c-g63r-vccr
- Warn: Project is vulnerable to: GHSA-cfm4-qjh2-4765
- Warn: Project is vulnerable to: GHSA-x4jg-mjrx-434g
- Warn: Project is vulnerable to: GHSA-hj48-42vr-x3v9
- Warn: Project is vulnerable to: GHSA-9wv6-86v2-598j
- Warn: Project is vulnerable to: GHSA-rhx6-c78j-4q9w
- Warn: Project is vulnerable to: GHSA-566m-qj78-rww5
- Warn: Project is vulnerable to: GHSA-7fh5-64p2-3v2j
- Warn: Project is vulnerable to: GHSA-hrpp-h998-j3pp
- Warn: Project is vulnerable to: GHSA-hxcm-v35h-mg2x
- Warn: Project is vulnerable to: GHSA-6g33-f262-xjp4
- Warn: Project is vulnerable to: GHSA-p8p7-x288-28g6
- Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw
- Warn: Project is vulnerable to: GHSA-m6fv-jmcg-4jfg
- Warn: Project is vulnerable to: GHSA-h9rv-jmmf-4pgx
- Warn: Project is vulnerable to: GHSA-hxcc-f52p-wc94
- Warn: Project is vulnerable to: GHSA-76p7-773f-r4q5
- Warn: Project is vulnerable to: GHSA-cm22-4g7w-348p
- Warn: Project is vulnerable to: GHSA-jv35-xqg7-f92r
- Warn: Project is vulnerable to: GHSA-4g88-fppr-53pp
- Warn: Project is vulnerable to: GHSA-4jqc-8m5r-9rpr
- Warn: Project is vulnerable to: GHSA-c9g6-9335-x697
- Warn: Project is vulnerable to: GHSA-2m39-62fm-q8r3
- Warn: Project is vulnerable to: GHSA-325j-24f4-qv5x
- Warn: Project is vulnerable to: GHSA-mf6x-7mm4-x2g7
- Warn: Project is vulnerable to: GHSA-j44m-qm6p-hp7m
- Warn: Project is vulnerable to: GHSA-3jfq-g458-7qm9
- Warn: Project is vulnerable to: GHSA-5955-9wpr-37jh
- Warn: Project is vulnerable to: GHSA-f5x3-32g6-xq36
- Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3
- Warn: Project is vulnerable to: GHSA-7p7h-4mm5-852v
- Warn: Project is vulnerable to: GHSA-pv4c-p2j5-38j4
- Warn: Project is vulnerable to: GHSA-46c4-8wrp-j99v
- Warn: Project is vulnerable to: GHSA-9m6j-fcg5-2442
- Warn: Project is vulnerable to: GHSA-hh27-ffr2-f2jc
- Warn: Project is vulnerable to: GHSA-rqff-837h-mm52
- Warn: Project is vulnerable to: GHSA-8v38-pw62-9cw2
- Warn: Project is vulnerable to: GHSA-hgjh-723h-mx2j
- Warn: Project is vulnerable to: GHSA-jf5r-8hm2-f872
- Warn: Project is vulnerable to: GHSA-5j4c-8p2g-v4jx
- Warn: Project is vulnerable to: GHSA-g3ch-rx76-35fx
- Warn: Project is vulnerable to: GHSA-wr3j-pwj9-hqq6
- Warn: Project is vulnerable to: GHSA-cf66-xwfp-gvc4
- Warn: Project is vulnerable to: GHSA-g78m-2chm-r7qv
- Warn: Project is vulnerable to: GHSA-c4w7-xm78-47vh
- Warn: Project is vulnerable to: GHSA-p9pc-299p-vxgp
Score
1.7
/10
Last Scanned on 2025-02-10
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn MoreOther packages similar to vue2-brace-editor
vue2-ace-editor
A Vue2.0's component based on ace/brace
vue-brace
前期我是用的 [vue2-ace](https://runkit.com/npm/vue2-ace) 用的过程当中发现了问题: 代码里面的 ``` vm.$parent.$emit('editor-update', editor.getValue()); ```
vue2-ace-editor-support-chinese
A Vue2.0's component based on last ace/brace
vue2-ace-editor-k
A Vue2.0's component based on ace/brace