Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

【暂无法修复】iframe 无法保持状态 #97

Open
CJY0208 opened this issue Jan 31, 2021 · 8 comments
Open

【暂无法修复】iframe 无法保持状态 #97

CJY0208 opened this issue Jan 31, 2021 · 8 comments
Labels
wontfix This will not be worked on

Comments

@CJY0208
Copy link
Owner

CJY0208 commented Jan 31, 2021

对 iframe 标签进行的 dom 移位操作一律会引起刷新,但 keep-alive 功能必须进行 dom 移位

此问题暂未寻到修正方式,暂不修复,请使用者注意

@CJY0208 CJY0208 added the wontfix This will not be worked on label Jan 31, 2021
@CJY0208 CJY0208 pinned this issue Jan 31, 2021
@CJY0208
Copy link
Owner Author

CJY0208 commented Jan 31, 2021

related: alitajs/umi-plugin-keep-alive#31

@Aaron52077
Copy link

Aaron52077 commented Jul 16, 2022

iframe相关可以使用ReactDOM.createPortal瞬移,这个思路貌似可行呢?https://wuli-admin.gitee.io/react-antd-template/#/dashboard

@lx815
Copy link

lx815 commented Feb 24, 2023

iframe相关可以使用ReactDOM.createPortal瞬移,这个思路貌似可行呢?https://wuli-admin.gitee.io/react-antd-template/#/dashboard

大佬,你发的这个示例项目有源码吗?想参考学习一下

@Aaron52077
Copy link

iframe相关可以使用ReactDOM.createPortal瞬移,这个思路貌似可行呢?https://wuli-admin.gitee.io/react-antd-template/#/dashboard

大佬,你发的这个示例项目有源码吗?想参考学习一下

https://gitee.com/wuli-admin/angular-mat-pro/tree/react18/

@HL0218
Copy link

HL0218 commented Oct 18, 2023

现在有人解决了,吗

@fandepeng1993
Copy link

同求,iframe 会重新加载
刷新~

@wangqi568827315
Copy link

iframe相关可以使用ReactDOM.createPortal瞬移,这个思路貌似可行呢?https://wuli-admin.gitee.io/react-antd-template/#/dashboard

根据大佬的思路,找到了一种方法

@wangqi568827315
Copy link

wangqi568827315 commented Dec 11, 2024

iframe相关可以使用ReactDOM.createPortal瞬移,这个思路貌似可行呢?https://wuli-admin.gitee.io/react-antd-template/#/dashboard

根据大佬的思路,找到了一种方法

// 是否显示
const [isShow, setIsShow] = React.useState(true);

useActivate(() => {
  setIsShow(true);
});

useUnactivate(() => {
  setIsShow(false);
});

const node = ReactDOM.createPortal(
  <iframe
    src=''
    style={{
      height: iframeHeight,
      width: '100%',
      border: 'none',
      display: isShow ? 'initial' : 'none'
    }}
  />,
  document.querySelector('#containerId'),
)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

6 participants