// 首先配置路由並隱藏菜單欄
const routes = [
{
name: '投保綜合查詢保單詳情頁',
icon: 'smile',
path: '/insureOfQuery/components/details',
component: './InsureOfQuery/components/Details',
// 隱藏菜單欄
menuRender: false,
// 隱藏菜單
hideInMenu: true,
}
];
export default routes;
const jumpDetails = () => {
const url = '/insureOfQuery/components/details?需要傳遞的數據' + ’需要傳遞的數據‘
window.open(url, '_blank', 'height=955,width=1269')?.focus() // 設置寬高 為 新頁面 大小 _blank 代表新頁面展示
}
//如何在新頁面獲取數據
useEffect(() => {
// 獲取信息
let obj = window.location
console.log(obj, 'obj');
}, [])
// 打印出window.location 會在search屬性中看到傳遞的字符串信息 通過截取 獲得自己想要的參數
在表格columns中配置
{
title: '投保單號',
width: 300,
align: 'center',
dataIndex: 'callNumber',
render: (callNumber) => <a style={{color: 'black'}} onClick={jumpDetails}>
{callNumber}
</a>
},
如圖所示 如果 直接引入public下的圖片 直接 引入就可以
export default () => {
return (
<ProCard bordered>
<img src="/logo.png"/>
</ProCard>
)
}
如果是icon文件下 <img src="/icons/icon-128×128.png"/>
