Skip to content

Is it working right now?  #21

Closed
@arneesh

Description

@arneesh

I added it to a Vue 3 project and the output I am getting is this(Attached a screenshot below). Even with specifically setting the language to js.

Dependency Versions

  • highlight.js": "^11.2.0
  • "@highlightjs/vue-plugin": "^2.1.0"

Installation

import hljs from 'highlight.js/lib/core';
import javascript from 'highlight.js/lib/languages/javascript';
import hljsVuePlugin from "@highlightjs/vue-plugin";
hljs.registerLanguage('javascript', javascript);

 app.use(hljsVuePlugin)

Usage: Step 1

<template>
       <highlightjs
        language="js"
        code="function chipPaginate(page) {
    if (typeof sortOrderNew === 'undefined')
        var sortOrder = 3;

    if (typeof sortOrderNew !== 'undefined')
        var sortOrder = sortOrderNew;

    console.log(sortOrder);
}
"
    />
</template>

Usage: Step 2

<script>
  components: {
        "highlightjs": hljsVuePlugin.component
  },
</script>

Output

Screenshot 2021-10-09 at 1 13 31 AM

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions