Blame view

babylon-vue-4.0.0/src/components/AppCodeHighlight.js 369 Bytes
0f94839d   함상기   babylon client fo...
1
2
3
4
5
6
7
8
9
10
11
12
13
  import Prism from 'prismjs';
  
  const CodeHighlight = {
      beforeMount(el, binding) {
          if (binding.modifiers.script) el.className = 'language-javascript';
          else if (binding.modifiers.css) el.className = 'language-css';
          else el.className = 'language-markup';
  
          Prism.highlightElement(el.children[0]);
      },
  };
  
  export default CodeHighlight;