JS 关闭子页面,刷新父页面

/**
 * 关闭子页面
 * @param {*} reflash 是否刷新父页面
 */
export function closeChildPage(reflash) {
  if (reflash) window.opener.parent.location.reload() // 刷新父页面
  window.opener = null
  window.open('', '_self')
  window.close()
}
posted @ 2023-03-01 20:19  jiazq  阅读(11)  评论(0编辑  收藏  举报