1.0.2 • Published 5 years ago

vue-hljs-lite v1.0.2

Weekly downloads
7
License
MIT
Repository
github
Last release
5 years ago

vue-hljs-lite

Lightweight highlight.js Vue component

Installation

npm install --save highlight.js vue-hljs-lite

npm package link

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.

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:

<vue-hljs-lite :code="code" :language="'xml'"></vue-hljs-lite>

Props

  • code: the code to highlight.
  • language: the language of the code to highlight.
1.0.2

5 years ago

1.0.1

5 years ago

0.0.3

5 years ago

0.0.2

6 years ago

0.0.1

6 years ago

0.0.0

6 years ago