跳到正文
Linasan UI

HtmlFrame HTML 预览

把一段不受信任的 HTML(邮件模板、富文本)放进沙箱 iframe 显示。

先用 DOMPurify 清理,再放进 sandbox iframe:脚本不执行,样式不影响外面的页面。

安装

pnpm dlx shadcn@latest add https://docs.linasan.cn/r/html-frame.json

第一次装本站的组件前先在项目里执行一次 shadcn init,详见 安装。

用法

import { HtmlFrame } from '@/components/display/html-frame';

属性

属性

类型

本页目录