Skip to content

Commit

Permalink
script setup example
Browse files Browse the repository at this point in the history
  • Loading branch information
moander committed Nov 24, 2023
1 parent f8e792c commit cdd4760
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,24 @@ 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/styles/stackoverflow-light.css'
import hljs from 'highlight.js/lib/core';
import javascript from 'highlight.js/lib/languages/javascript';
import { HighlightJs } from "@highlightjs/vue-plugin";
hljs.registerLanguage('javascript', javascript);
</script>
```

## Using the pre-built libraries

```html
Expand Down

0 comments on commit cdd4760

Please sign in to comment.