index.html 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <!doctype html>
  2. <title>CodeMirror: Vue.js mode</title>
  3. <meta charset="utf-8"/>
  4. <link rel=stylesheet href="../../doc/docs.css">
  5. <link rel="stylesheet" href="../../lib/codemirror.css">
  6. <script src="../../lib/codemirror.js"></script>
  7. <script src="../../addon/mode/overlay.js"></script>
  8. <script src="../../addon/mode/simple.js"></script>
  9. <script src="../../addon/selection/selection-pointer.js"></script>
  10. <script src="../xml/xml.js"></script>
  11. <script src="../javascript/javascript.js"></script>
  12. <script src="../css/css.js"></script>
  13. <script src="../coffeescript/coffeescript.js"></script>
  14. <script src="../sass/sass.js"></script>
  15. <script src="../pug/pug.js"></script>
  16. <script src="../handlebars/handlebars.js"></script>
  17. <script src="../htmlmixed/htmlmixed.js"></script>
  18. <script src="vue.js"></script>
  19. <style>.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
  20. <div id=nav>
  21. <a href="https://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
  22. <ul>
  23. <li><a href="../../index.html">Home</a>
  24. <li><a href="../../doc/manual.html">Manual</a>
  25. <li><a href="https://github.com/codemirror/codemirror">Code</a>
  26. </ul>
  27. <ul>
  28. <li><a href="../index.html">Language modes</a>
  29. <li><a class=active href="#">Vue.js mode</a>
  30. </ul>
  31. </div>
  32. <article>
  33. <h2>Vue.js mode</h2>
  34. <form><textarea id="code" name="code">
  35. <template>
  36. <div class="sass">Im am a {{mustache-like}} template</div>
  37. </template>
  38. <script lang="coffee">
  39. module.exports =
  40. props: ['one', 'two', 'three']
  41. </script>
  42. <style lang="sass">
  43. .sass
  44. font-size: 18px
  45. </style>
  46. </textarea></form>
  47. <script>
  48. // Define an extended mixed-mode that understands vbscript and
  49. // leaves mustache/handlebars embedded templates in html mode
  50. var mixedMode = {
  51. name: "vue"
  52. };
  53. var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
  54. mode: mixedMode,
  55. selectionPointer: true
  56. });
  57. </script>
  58. <p><strong>MIME types defined:</strong> <code>text/x-vue</code></p>
  59. </article>