
Security News
The Hidden Blast Radius of the Axios Compromise
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.
simple-code-editor
Advanced tools
Support for Vue.js 3
website: simple-code-editor.vicless.com
It's easy to use, both support read-only and edit mode with 200+ themes, you can directly use it in the browser or import it via the NPM package.
There are 2 common ways that you can use the simple-code-editor package:
Step 1. Add the CSS files.
<link rel="stylesheet" href="themes.css" />
<link rel="stylesheet" href="themes-base16.css" />
<link rel="stylesheet" href="simple-code-editor.css" />
Step 2. Add the JavaScript files after the vue.js file.
<script src="highlight.min.js"></script>
<script src="simple-code-editor.js"></script>
Step 3. Declaring the component, and using the customized tag into the HTML template.
const app = Vue.createApp({
components: {
"code-editor": CodeEditor,
},
});
<code-editor></code-editor>
Step 1. Install the package from NPM:
npm install simple-code-editor
Step 2. Importing the modules and registration.
import hljs from 'highlight.js';
import CodeEditor from "simple-code-editor";
export default {
components: {
CodeEditor,
},
};
<CodeEditor></CodeEditor>
BooleanDefault: false
Description: enable editable or not
<CodeEditor :read-only="true"></CodeEditor>
StringDefault: unset
Description: static content setting. If requiring data binding, please use the property: v-model
<CodeEditor value="console.log(13)"></CodeEditor>
Description: varies based on the value of form inputs element or output of components
<CodeEditor v-model="demo"></CodeEditor> <CodeEditor v-model="demo"></CodeEditor>
BooleanDefault: false
Description: enable line numbers to show or not, but unable in wrap text mode
<CodeEditor :line-nums="true"></CodeEditor>
ArrayDefault: [["javascript", "JS"]]
Description: [["language name", "display name"], ["language name", "display name"], ...]. Multiple languages setting will enable the language selector automatically, the language name is necessary, and the display name is optional
<CodeEditor :languages="[['cpp', 'C++']]" />
Multiple languages:
<CodeEditor :languages="[['cpp', 'C++'],['python', 'Python'],['php', 'PHP']]" />
NumberDefault: 2
<CodeEditor :tab-spaces="4"></CodeEditor>
BooleanDefault: false
Description: enable wrap text or not
<CodeEditor :wrap="true"></CodeEditor>
BooleanDefault: true
Description: enable header to show or not
<CodeEditor :header="true"></CodeEditor>
BooleanDefault: true
Description: enable language name to show or not
<CodeEditor :display-language="false"></CodeEditor>
BooleanDefault: true
Description: enable copy icon to show or not
<CodeEditor :copy-code="false"></CodeEditor>
StringDefault: github-dark
Description: freely switching between 200+ themes, check all the themes
<CodeEditor theme="github-dark"></CodeEditor>
StringDefault: 17px
<CodeEditor font-size="20px"></CodeEditor>
StringDefault: 540px
<CodeEditor width="100%"></CodeEditor>
StringDefault: auto
Description: the height of the container is adaptive by default, it also can be set as a specific value, and the scroll bar will work with overflow
<CodeEditor height="150px"></CodeEditor>
StringDefault: unset
<CodeEditor min-width="200px"></CodeEditor>
StringDefault: unset
<CodeEditor min-height="200px"></CodeEditor>
StringDefault: unset
<CodeEditor max-width="1000px"></CodeEditor>
StringDefault: unset
<CodeEditor max-height="200px"></CodeEditor>
StringDefault: 20px
<CodeEditor padding="30px"></CodeEditor>
StringDefault: 12px
<CodeEditor border-radius="4px"></CodeEditor>
StringDefault: 110px
Description: the width of language list
<CodeEditor lang-list-width="150px"></CodeEditor>
StringDefault: auto
Description: the height of the language list
<CodeEditor lang-list-height="70px"></CodeEditor>
BooleanDefault: false
Description: enable language list to show by default or not
<CodeEditor :lang-list-display="true"></CodeEditor>
StringDefault: 0
<CodeEditor z-index="6"></CodeEditor>
BooleanDefault: false
Description: enable textarea to get focused by default or not
<CodeEditor :autofocus="true"></CodeEditor>
Description: pass the current languange as an argument
<CodeEditor @lang="getLanguage"></CodeEditor>
getLanguage(lang) {
console.log("The current language is: " + lang);
}
Description: pass the static content as an argument
<CodeEditor @content="getContent"></CodeEditor>
getContent(content) {
console.log("The content is: " + content);
}
Description: pass the textarea element as an argument
<CodeEditor @textarea="focus"></CodeEditor>
focus(node) {
node.focus();
}
FAQs
Simple code editor for Vue.js
We found that simple-code-editor demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.