[Question] refresh()使用异常;
pxim opened this issue · comments
Peng Xiang commented
问题描述
"umi": "^3.5.0",
"umi-plugin-panel-tabs": "^0.0.28",
routes.ts
{
path: '/h53deditor',
name: 'h53deditor',
icon: 'form',
component: './editor/H53DEditor/index.router.tsx',
// hideInPanelTab: true,
hideInMenu: true,
},
业务模块
import { history, Link } from 'umi';
import { usePanelTab } from 'umi';
const {
close,
closeCurrent,
closeOther,
refresh,
refreshCurrent,
closeAll,
refreshAndCloseCurrent,
refreshAndCloseCurrentAndSwitch,
} = usePanelTab();
close({ name: 'h53deditor', location: { pathname: '/h53deditor' } });
refresh({ name: 'h53deditor', location: { pathname: '/h53deditor' } });
这两个hook,我用错了么,没有效果;
history.push('/h53deditor');
这句我使用是正常的。
示例代码
其他信息
ZhengJin commented
refresh是按照路由名称进行刷新的, 按理说传递 refresh({ name: 'h53deditor' });
就是有效的, 我目前的项目中没有遇到这个问题, 可以提供复现仓库吗?