Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/byteboomers/vue-hljs-lite
Lightweight highlight.js Vue component
https://github.com/byteboomers/vue-hljs-lite
highlight-js hljs vue vue-hljs-lite vuejs
Last synced: 11 days ago
JSON representation
Lightweight highlight.js Vue component
- Host: GitHub
- URL: https://github.com/byteboomers/vue-hljs-lite
- Owner: byteboomers
- License: mit
- Created: 2018-10-27T08:59:21.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2024-08-30T11:52:42.000Z (6 months ago)
- Last Synced: 2025-01-28T09:51:55.448Z (24 days ago)
- Topics: highlight-js, hljs, vue, vue-hljs-lite, vuejs
- Language: JavaScript
- Size: 659 KB
- Stars: 43
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# vue-hljs-lite
Lightweight highlight.js Vue component
## Installation
```bash
npm install --save highlight.js vue-hljs-lite
```[npm package link](https://www.npmjs.com/package/vue-hljs-lite)
## Usage
Inside your main.js:
The default highlight.js import imports all languages, it is therefore likely to be more efficient to import only the library and the languages you need.
```javascript
import hljs from "highlight.js/lib/highlight";
import xml from "highlight.js/lib/languages/xml";
hljs.registerLanguage("xml", xml);import VueHljsLite from "vue-hljs-lite";
Vue.use(VueHljsLite, { hljs });
```Inside any component:
```html
```
## Props
- **code**: the code to highlight.
- **language**: the language of the code to highlight.