custom-icon.html 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>vue html5 editor demo</title>
  6. <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport"/>
  7. <script src="../dist/vue-html5-editor.js"></script>
  8. <script src="https://cdn.bootcss.com/vue/2.2.6/vue.js"></script>
  9. <style>
  10. #app {
  11. margin: 50px auto;
  12. width: 800px;
  13. max-width: 100%;
  14. }
  15. .custom-icon {
  16. background-size: 100% 100%;
  17. display: inline-block;
  18. }
  19. .custom-icon.text {
  20. background-image: url(custom-icons/text.png);
  21. }
  22. .custom-icon.font {
  23. background-image: url(custom-icons/font.png);
  24. }
  25. .custom-icon.align {
  26. background-image: url(custom-icons/align.png);
  27. }
  28. .custom-icon.list {
  29. background-image: url(custom-icons/list.png);
  30. }
  31. .custom-icon.color {
  32. background-image: url(custom-icons/color.gif);
  33. }
  34. .custom-icon.eraser {
  35. background-image: url(custom-icons/eraser.gif);
  36. }
  37. .custom-icon.full-screen {
  38. background-image: url(custom-icons/full-screen.gif);
  39. }
  40. .custom-icon.hr {
  41. background-image: url(custom-icons/hr.gif);
  42. }
  43. .custom-icon.image {
  44. background-image: url(custom-icons/image.gif);
  45. }
  46. .custom-icon.link {
  47. background-image: url(custom-icons/link.gif);
  48. }
  49. .custom-icon.table {
  50. background-image: url(custom-icons/table.gif);
  51. }
  52. .custom-icon.undo {
  53. background-image: url(custom-icons/undo.gif);
  54. }
  55. .custom-icon.unlink {
  56. background-image: url(custom-icons/unlink.gif);
  57. }
  58. .custom-icon.info {
  59. background-image: url(custom-icons/info.png);
  60. }
  61. </style>
  62. </head>
  63. <body>
  64. <div id="app">
  65. <vue-html5-editor :content.sync="content" :height="500"></vue-html5-editor>
  66. </div>
  67. <script>
  68. Vue.use(VueHtml5Editor, {
  69. image: {compress: false},
  70. icons: {
  71. text: "custom-icon text",
  72. color: "custom-icon color",
  73. font: "custom-icon font",
  74. align: "custom-icon align",
  75. list: "custom-icon list",
  76. link: "custom-icon link",
  77. unlink: "custom-icon unlink",
  78. tabulation: "custom-icon table",
  79. image: "custom-icon image",
  80. "horizontal-rule": "custom-icon hr",
  81. eraser: "custom-icon eraser",
  82. hr: "custom-icon hr",
  83. undo: "custom-icon undo",
  84. "full-screen": "custom-icon full-screen",
  85. info: "custom-icon info ",
  86. }
  87. })
  88. new Vue({
  89. el: "#app",
  90. data: {
  91. content: "<h3>vue html5 editor</h3>",
  92. }
  93. })
  94. </script>
  95. </body>
  96. </html>