
Security News
ECMAScript 2025 Finalized with Iterator Helpers, Set Methods, RegExp.escape, and More
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.
vue-prism-component
Advanced tools
yarn add vue-prism-component
First you need to load Prism
somewhere in your app:
// yarn add prismjs
import 'prismjs'
import 'prismjs/themes/prism.css'
OR:
<link rel="stylesheet" href="https://unpkg.com/prismjs/themes/prism.css" />
<script src="https://unpkg.com/prismjs"></script>
Then In SFC:
<template>
<prism language="javascript">{{ code }}</prism>
</template>
<script>
import Prism from 'vue-prism-component'
export default {
data() {
return {
code: 'const a = b'
}
},
components: {
Prism
}
}
</script>
Or In JSX:
<Prism language="html">{`
<div>
<strong>foo</strong>
</div>
`}</Prism>
You can also set the code using a prop:
import 'prismjs/components/prism-rust'
<Prism language="rust" code={ myRustCode } />
git checkout -b my-new-feature
git commit -am 'Add some feature'
git push origin my-new-feature
vue-prism-component © egoist, Released under the MIT License.
Authored and maintained by egoist with help from contributors (list).
egoistian.com · GitHub @egoist · Twitter @rem_rin_rin
FAQs
vue component for prism.js
The npm package vue-prism-component receives a total of 31,770 weekly downloads. As such, vue-prism-component popularity was classified as popular.
We found that vue-prism-component 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
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.
Security News
A new Node.js homepage button linking to paid support for EOL versions has sparked a heated discussion among contributors and the wider community.
Research
North Korean threat actors linked to the Contagious Interview campaign return with 35 new malicious npm packages using a stealthy multi-stage malware loader.