Iframe 内嵌框架 new

带有加载状态和错误处理的 iframe 组件。

安装

npm
yarn
pnpm
bun
deno
npx shadcn@latest add https://codebase.anyask.dev/r/iframe.json

基础用法

受控模式

通过 loadingerror props 直接控制组件状态。

自定义配置

通过 boundaryProps 自定义错误处理和重试行为。

API

Iframe

属性说明类型默认值
src*iframe 地址string-
errorMessage加载失败时的提示文本string加载页面失败
loadingImage自定义加载时的占位图stringhttps://img.alicdn.com/tfs/TB1CmVgayERMeJjy0FcXXc7opXa-308-200.gif
boundaryPropsBoundaryBlock 配置BoundaryBlockProps-