为了测试或演示,可以使用我们的 esm.sh CDN 构建版本。以下是你需要的几行代码来开始:

    1. <!doctype html>
    2. <html>
    3. <head>
    4. <meta charset="utf-8" />
    5. </head>
    6. <body>
    7. <div class="element"></div>
    8. <script type="module">
    9. import { Editor } from 'https://esm.sh/@tiptap/core'
    10. import StarterKit from 'https://esm.sh/@tiptap/starter-kit'
    11. const editor = new Editor({
    12. element: document.querySelector('.element'),
    13. extensions: [StarterKit],
    14. content: '<p>Hello World!</p>',
    15. })
    16. </script>
    17. </body>
    18. </html>