
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
vue-code-highlighter
Advanced tools
Vue component for highlighting code or syntax with modern style, copy functionality, multicode and powered by Highlight.js
Vue component for highlighting code or syntax with modern style, copy functionality, multicode and powered by Highlight.js
npm install vue-code-highlighter highlight.js
// or use yarn
yarn add vue-code-highlighter highlight.js
This package support either composition and options api with typescript or javascript.
import { VueCodeHighlighter, VueCodeHighlighterMulti } from 'vue-code-highlighter';
import 'vue-code-highlighter/dist/style.css'
This package does not need to call CSS from the highlight.js package because I have already wrapped it. What you need to do is install the highlight.js package.
Example code and demo available in ichsanputr.github.io/vue-code-highlighter
There are 2 types of components, namely VueCodeHighlighter and VueCodeHighlighterMulti, both of them have different props.
VueCodeHighlighter
Attribute | Type | Is Required | Description |
---|---|---|---|
lang | String | true | Code languange from Highlighter cheatset, see Supported languange |
code | String | true | Plain code which will be displayed, please wrap your code using backtick (``) |
title | String | no | Custom title in header |
disableCopy | Boolean | no | Disable copy button and copy functionality to code |
VueCodeHighlighterMulti
Attribute | Type | Is Required | Description |
---|---|---|---|
lang | Array | true | See example below |
disableCopy | Boolean | no | Disable copy button and copy functionality to code |
Example for lang props in Multi Code.
const codeMulti = [
{
lang: "js",
title: "vue",
code: codeVue.value
},
{
lang: "html",
code: codeHtml.value,
title: 'html'
},
{
lang: "css",
code: codeCss.value,
},
]
FAQs
Vue component for highlighting code or syntax with modern style, copy functionality, multicode and powered by Highlight.js
The npm package vue-code-highlighter receives a total of 287 weekly downloads. As such, vue-code-highlighter popularity was classified as not popular.
We found that vue-code-highlighter 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
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.