highlightjs / vue-plugin

Highlight.js Vue Plugin
BSD 3-Clause "New" or "Revised" License
200 stars 28 forks source link

Export component to allow usage without registering as plugin #46

Open moander opened 9 months ago

moander commented 9 months ago

I also added a script setup example using the component.

moander commented 9 months ago

I see now that it is already documented how to do that.. But script setup with that additional export saves you a few lines :-)

<template>
    <highlight-js autodetect code="function() {}" />
</template>

<script setup>
import 'highlight.js/lib/common';
import { HighlightJs } from "@highlightjs/vue-plugin";
</script>