mirror of
https://github.com/XiaoDaiGua-Ray/ray-template.git
synced 2026-12-01 17:23:40 +08:00
Improve theme consistency, keyboard navigation, and reusable frontend components. Harden fullstack initialization and expose scoped lint and Vitest commands.
3.1 KiB
3.1 KiB
RIframe
RIframe wraps a native iframe and Naive UI Spin. Embed pages that permit it. The embedded page's CSP, framing permissions, and same-origin policy still apply. The load event signals a frame load. Verify business content separately where needed.
Interactive example
::: details View example source <<< @/../admin/src/views/demo/iframe/index.tsx :::
import { RIframe } from '@/components'
export const renderReport = (url: string) => (
<RIframe src={url} title="Inventory report" height={460} lazy="eager" />
)
| Prop | Default | Description |
|---|---|---|
src |
Required | iframe URL. If it comes from user input, enforce application-approved origins. |
width / height |
'100%' |
CSS dimensions. Percentage heights depend on the parent. |
frameborder |
0 |
Template border style value. |
iframeWrapperClass / iframeClass |
None | Classes for the wrapper and native iframe. |
title / name / allow |
None | Native iframe attributes. Provide title for assistive technology. |
sandbox / referrerpolicy |
None | Pass native embedding restrictions and referrer policy to the iframe. An empty sandbox string applies every sandbox restriction. |
lazy |
true |
true or 'lazy' defers loading. false or 'eager' loads eagerly. |
customSpinProps |
{} |
NSpin configuration. Internal state controls show. |
onSuccess(iframe, event) and onError(event) accept a callback or array. Each src change shows the spinner until load or error. The component ref exposes the native element as iframe and its compatibility alias iframeInst, both null before mounting. Vue already unwraps them. Additional slots go to Spin, and the iframe remains the default content.