📝 README updated 📝 👈🏼 ✏️ ☝🏼
This commit is contained in:
parent
067281b7a3
commit
34fe75070a
7 changed files with 162 additions and 34 deletions
31
src/components/Download.js
Normal file
31
src/components/Download.js
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
import React from 'react';
|
||||
import {buildURI} from '../core';
|
||||
import {defaultProps as CommonDefaultProps, PropTypes} from '../metaProps';
|
||||
|
||||
const defaultProps = {
|
||||
target: '_blank'
|
||||
};
|
||||
class CSVDownload extends React.Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
}
|
||||
componentDidMount(){
|
||||
this.page = window.open(buildURI(this.props.data, this.props.headers), this.props.target, this.props.specs, this.props.replace);
|
||||
}
|
||||
|
||||
getWindow() {
|
||||
return this.page;
|
||||
}
|
||||
|
||||
render(){
|
||||
return (null)
|
||||
}
|
||||
}
|
||||
|
||||
CSVDownload.defaultProps = Object.assign(
|
||||
CommonDefaultProps,
|
||||
defaultProps
|
||||
);
|
||||
CSVDownload.PropTypes = PropTypes;
|
||||
|
||||
export default CSVDownload;
|
||||
Loading…
Add table
Add a link
Reference in a new issue