Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
vue-code-highlight
Advanced tools
Beautiful code syntax highlighting as Vue.js component.
npm install vue-code-highlight --save
Now, you can use this module in two diferrent ways, as a component or as a directive.
In any component:
// You have to extract the component from the module
import { component as VueCodeHighlight } from 'vue-code-highlight';
components:{
VueCodeHighlight,
...
}
<vue-code-highlight>
//Paste your code here
</vue-code-highlight>
Your content will be highlighted dynamically when it updates.
Window styles are already present in a component mode, but you will need to select and include a theme to properly highlight your code. (See the themes section.)
In your main file:
import VueCodeHighlight from 'vue-code-highlight';
Vue.use(VueCodeHighlight) //registers the v-highlight directive
And then in any Vue component:
<div v-highlight >
...
</div>
All markup under the div element having the following structure will be syntax highlighted.
<pre class="language-javascript">
<code>
//your code goes here
</code>
</pre>
To give the highlighter a window look in a directive mode, also don't forget to include the ./node_modules/vue-code-highlight/themes/window.css
file somewhere in your app.
In order to visually higlight your code, you need to select a theme from ./node_modules/vue-code-highlight/themes/
and import it somewhere into your component/application. These are just regular prism themes, so feel free to improvise.
FAQs
> Beautiful code syntax highlighting as Vue.js component.
The npm package vue-code-highlight receives a total of 4,801 weekly downloads. As such, vue-code-highlight popularity was classified as popular.
We found that vue-code-highlight demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.