feat: add srcdoc property to IFrameBlock element #454

This commit is contained in:
Hufe921
2024-04-17 22:11:47 +08:00
parent 5027d730c4
commit 66969925ac
6 changed files with 31 additions and 12 deletions
@@ -20,7 +20,11 @@ export class IFrameBlock {
iframe.style.border = 'none'
iframe.style.width = '100%'
iframe.style.height = '100%'
iframe.src = block.iframeBlock?.src || ''
if (block.iframeBlock?.src) {
iframe.src = block.iframeBlock.src
} else if (block.iframeBlock?.srcdoc) {
iframe.srcdoc = block.iframeBlock.srcdoc
}
blockItemContainer.append(iframe)
}
}
+2 -1
View File
@@ -1,7 +1,8 @@
import { BlockType } from '../dataset/enum/Block'
export interface IIFrameBlock {
src: string
src?: string
srcdoc?: string
}
export interface IVideoBlock {