Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/point-hub/vue-highlight
Vue 3 directive for highlight.js
https://github.com/point-hub/vue-highlight
Last synced: 2 months ago
JSON representation
Vue 3 directive for highlight.js
- Host: GitHub
- URL: https://github.com/point-hub/vue-highlight
- Owner: point-hub
- License: mit
- Created: 2020-11-15T08:18:22.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2021-05-08T04:06:15.000Z (over 3 years ago)
- Last Synced: 2024-11-01T17:04:20.459Z (2 months ago)
- Language: JavaScript
- Size: 525 KB
- Stars: 8
- Watchers: 5
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-vue-3 - vue-highlight - Vue 3 directive for highlight.js. (Packages)
README
# @point-hub/vue-highlight
Vue 3 directive for highlight.js
## Installation
```
yarn add @point-hub/vue-highlightor
npm install @point-hub/vue-highlight --save
```## Usage
Import plugin in your main.js file
```
import Highlight from "@point-hub/vue-highlight";
import "highlight.js/styles/atom-one-dark.css";// Import Languages
import javascript from "highlight.js/lib/languages/javascript";
import html from "highlight.js/lib/languages/xml";// Register Language
Highlight.registerLanguage("html", html);
Highlight.registerLanguage("javascript", javascript);const app = createApp(App);
app.use(Highlight.plugin);
app.mount("#app");
```And use it into your view
```
function say(text) {
alert(text)
}say('Hello')
```