Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export component to allow usage without registering as plugin #46

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,19 @@ This plugin provides a `highlightjs` component for use in your Vue.js 3 applicat

Note: For Vue.js version 2 support see the [1-stable](https://github.com/highlightjs/vue-plugin/tree/1-stable) branch here on GitHub. Version 1.x.x is compatible with Vue.js v2; version 2.x.x with Vue.js v3.

## Using script setup

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

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

## Using the pre-built libraries

```html
Expand Down
2 changes: 2 additions & 0 deletions src/vue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,3 +82,5 @@ const plugin: Plugin & { component: typeof component } = {
}

export default plugin

export const HighlightJs = component