2

I am currently writing documentation for a Vue Component library, utilizing VuePress. Using VuePress' markdown I am able to display code with <<< ./path/to/file.vue for example. This is nice because VuePress uses prism.js for displaying code and has a custom prism language for Vue syntax highlights (analyzing the html shows that a language-vue class is applied to the codeblock).

No I am using a Vue component that Build to dynamically display some code snippets based on component props.

Inside my component, I am using the following pre/code syntax.

<pre class="language-vue">
  <code ref="codesnippet">
    {{codeOutput}}
  </code>
</pre>

This displays a code box, but doesn't apply the language-vue CSS theme to it that VuePress uses in its code blocks. Is it possible to add this to my own component somehow, as prism.js is installed by VuePress.

Maik Lowrey
  • 15,957
  • 6
  • 40
  • 79
Flowmotion
  • 143
  • 1
  • 1
  • 6

0 Answers0