PdfView.js 597 Bytes
import React,{PropTypes} from 'react';   
import cx from 'classnames';
import s from './pdfView.scss';
import {showPdfView} from '../../utils/fileUtil';

class PdfView extends React.Component {
	constructor (props, context) {
	    super(props, context);  
	    this.showPdf=this.showPdf.bind(this); 
	} 
	static propTypes = {   
    	pdfPath:PropTypes.string,
    	name: PropTypes.string
	}  
	showPdf(){
		console.log(this.props.pdfPath);
		showPdfView(this.props.pdfPath);
	}
	render(){ 
		return( 
			<a href="javascript:;" onClick={this.showPdf}>查看</a>
		)
	}
}
 


export default PdfView;