Check this link out: https://www.dyn-web.com/tutorials/iframes/dyn-gen/
In the initialize function, you could create and store the iframe:
(using vanilla javascript)
instance.data.iframe = document.createElement(‘iframe’);
Then, assuming you’re trying to use some dynamic data that the user is going to give you, in the “update” function, you access the properties object:
var iframe = instance.data.iframe
iframe.setAttribute(‘src’, properties.yourDynamicData)