import Vue from 'vue';import VueHighlightJS from 'vue-highlight.js';// Highlight.js languagesimport javascript from 'highlight.js/lib/languages/javascript';import vue from 'vue-highlight.js/lib/languages/vue';/* * Import Highlight.js theme * Find more: https://highlightjs.org/static/demo/ */import 'highlight.js/styles/default.css';import App from './App';/* * Use Vue Highlight.js */Vue.use(VueHighlightJS, { // Register only languages that you want languages: { javascript, vue
You have to escape all HTML tags before add it into slot.
If you didn't do that, browser will interpret those tags as HTML element.
ℹ️ See isagalaev/highlight.js#866
If you use code property instead of slot, you don't need to worry about this. Vue Highlight.js will automatically escape it for you.
Why did I get SyntaxError: Unterminated template literal error when used <script></script> in code property?