Vue component for formatting code using Prism.js
npm install vue-prismjs-next
In your component:
<template>
<prismjs language="javascript">
// your code here
</prismjs>
</template>
<script>
import Prismjs from 'vue-prismjs-next'
export default {
components: {
Prismjs
}
}
</script>
In your main.js
file:
import Prismjs from './Prismjs.vue';
// ...
app.component('Prismjs', Prismjs)
// ...
language
(required): The language to use for syntax highlighting. You can find a list of supported languages here.code
(required): Code string.
- Vue 2.x
- Vue 3.x (using
vue-demi
)
npm install
npm run build
npm run watch
npm test
npm run storybook