示例工程 16-iframe-embed

16-iframe-embed/app/assets/widget.html

html · 0.7 KB

运行:iframe 与嵌入 · title / sandbox / loading

点击「运行示例」后,左侧显示源码、右侧显示运行结果;console 输出会实时回传。

<!doctype html>
<html lang="zh-CN">
  <head>
    <meta charset="utf-8" />
    <title>嵌入组件</title>
    <style>
      body { margin: 0; padding: 16px; background: #eff6ff; color: #1e3a8a; font-family: system-ui, sans-serif; line-height: 1.6; }
      h2 { margin: 0 0 8px; font-size: 18px; }
      p { margin: 0 0 6px; font-size: 14px; }
      .tag { display: inline-block; padding: 2px 8px; border-radius: 999px; background: #bfdbfe; font-size: 12px; }
    </style>
  </head>
  <body>
    <h2>产品更新摘要</h2>
    <p>这是被嵌入的本地页面,独立于父页面渲染。</p>
    <p><span class="tag">v1.2</span> 新增 iframe 示例。</p>
  </body>
</html>