reactjs - 如何在反应js中调用从一个组件到另一个组件的方法(在新选项卡中)
问题描述
在我的应用程序中,我们使用哈希路由器并使用 window.open 在新窗口中呈现 BillingManagement 组件,如下所示
winObj = window.open('#/BillingManagement');
var that = this;
winObj.onclick = function (event) {
if (event.target.id === "someID") {
that.currentWindowLogOut();
}
}
我想从 BillingManagement 窗口调用此组件的方法。当 BillingManagement 窗口未刷新时,它对我来说工作正常。如何从 Billingmanagement 窗口调用方法,反之亦然。
解决方案
推荐阅读
- python - 在 Python 中使用模板文字对 2D 列表进行排序
- google-cloud-platform - 如何创建令牌以从 Artifact Registry 中提取单个容器?
- node.js - Nestjs Svelte - 在 Svelte 文件中导入 apexcharts
- javascript - Rxjs - 收集所有未处理的值
- asp.net-core - ASP.NET Core 应用程序中的 AAD 身份验证未返回正确的标头
- javascript - 仅当用户是人类(reCaptcha v3)时,如何加载和插入一些 HTML?
- python - xlwings 和 ipython 并排 - 如何以交互方式使用 XLWINGS 从 EXCEL 文件执行 jupyter notebook?
- python - 如何检查数组列表中的数组 - Python
- ios - 使用三元运算符设置 UIButton 图像
- mysql - 在准备好的语句中将布尔值与 json 进行比较