custom-element.html 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. <!doctype html>
  2. <html lang="zh-CN">
  3. <head>
  4. <meta charset="UTF-8" />
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  6. <title>Flyfish Viewer Custom Element Demo</title>
  7. </head>
  8. <body data-wrapper="custom-element">
  9. <main class="app-shell">
  10. <header class="topbar">
  11. <div>
  12. <h1>Vanilla JS Custom Element</h1>
  13. <p>原生 <code>&lt;flyfish-file-viewer&gt;</code> 组件,支持属性、property、事件和完整 controller API。</p>
  14. </div>
  15. <nav class="topbar-actions" aria-label="Demo links">
  16. <a href="/index.html">React / Web</a>
  17. <a href="/manual-js.html">Manual JS</a>
  18. <a href="/manual-iife.html">Script tag</a>
  19. </nav>
  20. </header>
  21. <section class="single-viewer-shell">
  22. <flyfish-file-viewer
  23. id="custom-element-viewer"
  24. class="viewer-host"
  25. src="/example/word.docx"
  26. filename="word.docx"
  27. theme="light"
  28. toolbar-position="bottom-right"
  29. search="true"
  30. data-testid="custom-element-viewer-host"
  31. ></flyfish-file-viewer>
  32. </section>
  33. </main>
  34. <script type="module" src="/src/custom-element-demo.ts"></script>
  35. </body>
  36. </html>