highlightjs / vue-plugin

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

Export component to allow usage without registering as plugin #46

Open moander opened 12 months ago

moander commented 12 months ago

I also added a script setup example using the component.

moander commented 12 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>