如何从ReactJS导航中打开newtab中的PDF文档?

时间:2016-11-16 03:02:45

标签: javascript ecmascript-6 redux reactive-programming

如何从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

0 个答案:

没有答案