You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

69 lines
2.0 KiB

7 months ago
  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/5"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png" alt=""></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/codemirror5">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">I'm 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>