Gathering detailed insights and metrics for vue2-brace-editor
Gathering detailed insights and metrics for vue2-brace-editor
Gathering detailed insights and metrics for vue2-brace-editor
Gathering detailed insights and metrics for 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
npm install vue2-brace-editor
Typescript
Module System
Node Version
NPM Version
Vue (84.15%)
JavaScript (15.85%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
15 Stars
16 Commits
7 Forks
1 Watchers
1 Branches
2 Contributors
Updated on Nov 18, 2022
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
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
A Vue components for Ace / Brace
npm install vue2-brace-editor
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
This is the main component of Vue2-brace. It creates an instance of the Ace Editor.
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 |
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.
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 |
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.
This app and its functions are limited by time constraint and is in no way at its best.
Hector Johnson - github.com/hector101
(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
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
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
117 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-07-07
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 More