如何从ReactJS导航中在newtab中打开pdf文档?
菜单的:
{
key: 'yourServerObligMenu',
name: 'Your Service Obligation ',
path: '/serviceObligation',
icon: 'glyphicon glyphicon-paperclip',
active: false
},
路线:
import YourServiceObligationPage from './pages/YourServiceObligation'
<Route path='serviceObligation' component={YourServiceObligationPage} />
的网页:
import ServiceObligationContent from '../components/serviceObligation/ServiceObligationContent';
export default class YourServiceObligation extends Component {
render() {
return (
<div>
<ServiceObligationContent/>
</div>
);
}
}
成分:
export default class ServiceObligationContent extends Component {
render() {
return (
<Link to="/documents/YourServiceObligation.pdf" target="_blank">
);
}
}
点击导航栏菜单后,我无法在新标签页中打开文档 serviceobligation