Closed
Description
I added it to a Vue 3 project and the output I am getting is this(Attached a screenshot below). Even with specifically setting the language to js.
Dependency Versions
- highlight.js": "^11.2.0
- "@highlightjs/vue-plugin": "^2.1.0"
Installation
import hljs from 'highlight.js/lib/core';
import javascript from 'highlight.js/lib/languages/javascript';
import hljsVuePlugin from "@highlightjs/vue-plugin";
hljs.registerLanguage('javascript', javascript);
app.use(hljsVuePlugin)
Usage: Step 1
<template>
<highlightjs
language="js"
code="function chipPaginate(page) {
if (typeof sortOrderNew === 'undefined')
var sortOrder = 3;
if (typeof sortOrderNew !== 'undefined')
var sortOrder = sortOrderNew;
console.log(sortOrder);
}
"
/>
</template>
Usage: Step 2
<script>
components: {
"highlightjs": hljsVuePlugin.component
},
</script>
Output
Metadata
Metadata
Assignees
Labels
No labels