Last active
November 18, 2023 14:05
-
-
Save svierk/624b37fdd67bebfd8c760773c7c3b34e to your computer and use it in GitHub Desktop.
JS code for iFrame LWC
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { api, LightningElement } from 'lwc'; | |
export default class IFrame extends LightningElement { | |
@api height = '500px'; | |
@api sandbox = ''; | |
@api url = ''; | |
@api width = '100%'; | |
renderedCallback() { | |
if (this.sandbox) { | |
const element = this.template.querySelector('iframe'); | |
element.sandbox = this.sandbox; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment