|
@@ -64,9 +64,28 @@ function C1unity() {
|
|
|
return arr
|
|
|
}, [ind, urlId])
|
|
|
|
|
|
+ useEffect(() => {
|
|
|
+ if (url) {
|
|
|
+ // 待完善
|
|
|
+ const body = document.querySelector('body')
|
|
|
+ const iframe = document.createElement('iframe')
|
|
|
+ iframe.frameBorder = 'none'
|
|
|
+ iframe.title = '漫游'
|
|
|
+ iframe.id = 'myIframe'
|
|
|
+ iframe.src = url
|
|
|
+ body?.appendChild(iframe)
|
|
|
+ }
|
|
|
+
|
|
|
+ return () => {
|
|
|
+ const iframeDom = document.querySelector('#myIframe')
|
|
|
+
|
|
|
+ iframeDom?.remove()
|
|
|
+ }
|
|
|
+ }, [url])
|
|
|
+
|
|
|
return (
|
|
|
<div className={styles.C1unity}>
|
|
|
- {url ? <iframe frameBorder='none' title='漫游' src={url}></iframe> : null}
|
|
|
+ {/* {url ? <iframe frameBorder='none' title='漫游' src={url}></iframe> : null} */}
|
|
|
|
|
|
{/* 返回按钮 */}
|
|
|
<BtnRight imgName='back' clickSon={() => history.go(-1)} title='返回' />
|