bricks/docs/zh/iframe.md
2025-11-19 12:30:39 +08:00

33 lines
1.3 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# NewWindow
## 控件功能,类型(普通控件或容器控件),父类控件
- **控件功能**:打开一个新浏览器窗口,加载指定 URL。
- **控件类型**:普通控件
- **父类控件**`bricks.JsWidget`
## 初始化参数
| 参数名 | 类型 | 必填 | 说明 |
|--------|--------|------|------|
| `url` | string | 是 | 要在新窗口中打开的页面 URL。 |
| `name` | string | 否 | 新窗口的名称(即 `window.open` 的第二个参数),默认为 `'_blank'`,表示新建标签页。 |
## 主要事件
无主要事件。该控件在初始化时立即执行 `window.open()`,不提供可监听的事件。
---
# Iframe
## 控件功能,类型(普通控件或容器控件),父类控件
- **控件功能**:创建一个内嵌的 iframe 框架,用于在当前页面中嵌入另一个网页,支持设置高度并自动加载指定 URL。
- **控件类型**:普通控件
- **父类控件**`bricks.Layout`
## 初始化参数
| 参数名 | 类型 | 必填 | 说明 |
|----------|--------|------|------|
| `url` | string | 是 | 要嵌入的 iframe 页面地址。 |
| `height` | string 或 number | 否 | iframe 的高度,默认值为 `'100%'`。 |
## 主要事件
无主要事件。该控件在构造函数中直接设置 `src` 属性,加载页面,未定义自定义事件。