Skip to content

Iframe

Use type: 2 with no slot so the iframe options pass directly to layui:

vue
<S3Layer
  v-model="visible"
  :options="{
    type: 2,
    title: 'Iframe',
    content: 'https://layui.dev',
    area: ['80%', '80%'],
    maxmin: true
  }"
/>

常用配置:

参数说明
type: 2指定 iframe 层。
contentiframe URL。
areaiframe 弹层宽高。
maxmin是否允许最大化/最小化。

原生 iframe 方法:

ts
layer.iframeAuto(index)
layer.iframeSrc(index, 'https://layui.dev')
const frame = layer.getChildFrame('body', index)