vue3-highlightjs
Version:
Syntax highlighting with highlight.js for Vue.js 3.x
2 lines (1 loc) • 585 B
JavaScript
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("highlight.js")):"function"==typeof define&&define.amd?define(["highlight.js"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).Vue3Highlightjs=t(e.hljs)}(this,(function(e){"use strict";function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var i=t(e);return function(e){e.directive("highlightjs",(function(e,t){for(var n=e.querySelectorAll("code"),o=0;o<n.length;o++){var l=n[o];"string"==typeof t.value&&(l.textContent=t.value),i.default.highlightBlock(l)}}))}}));