如何解决highlightjs在vue?
So, simply add v-highlightjs
to each tag that is supposed to be highlighted开发者_如何转开发. That will re-highlight those tags each time Vue inserts them into the DOM (router navigation to another component etc...)
shenme_2015 14小时前 开发者_JAVA百科
you should not use that global init function, as it is intended to highlight all pre tags on page load, and is meant to be used on static pages.
360U3180755915 14小时前
Highlightjs offers a method开发者_C百科 for "Custom Initialization"with hljs.highlightBlock()
, which you should warp in a custom directive:
精彩评论