Skip to content

Example code (in codesandbox) is wrong, and doesn't work even after fixing it #15

@dbersan

Description

@dbersan

I need to use the directive mode, however, it doesn't work.

I noticed the codesandbox (here) has an example using the directive mode. You should just need to comment out <component-example/> and uncomment the directive one.

However the code for DirectiveExample.vue is wrong, it should be:

<template>
  <div>
    <h2>vue-code-highlight example</h2>
    <div v-highlight>
      <pre class="language-javascript">
        <code>
          let isPalindrome = (word) => {
            let [length, result] = [word.length, true];
            for (let i = 0; i &lt; length / 2; i++) {
            if (word[i] !== word[length - 1 - i]) result = false;
            }
            return result;
            }
            module.exports = isPalindrome;
      </code>
    </pre>
      
    </div>
  </div>
</template>

But it gives wrong result (i.e., no syntax highlight)

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions