Skip to content

Propose: Better support Vue simple use cases #2535

@joshgoebel

Description

@joshgoebel

Vue

The two examples I found fast:

Both use directives... wouldn't you really want a component for this though? What I have so far for Vue:

<highlightjs language="javascript" code="var x = 5;" />
<highlightjs language="javascript" v-bind:code="sourceCode" ignore_illegals />
<highlightjs v-bind:code="sourceCode" />
<!-- or to be explicit -->
<highlightjs auto :code="sourceCode" />
<highlightjs autodetect :code="sourceCode" />

Using a slot for passing in code has all the same problems of using a non-PRE tag in HTML and many additional problems so that doesn't seem like a good route, so I've rule that out.

Vue questions:

  • Component vs directive.
  • Dash or no dash or is that something that you should configure when you setup the plugin, ie using a custom tag name?
  • Would people be expecting to configure the whole library via HTML "attributes" though? I suppose you could have an options attribute thought that took an object...

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions