尝试添加下载按钮

问题描述

我在一个项目中工作,我想添加一个下载按钮,但我找不到方法。我正在显示我想要添加按钮的部分代码

        axios.post("/notas",data)
            .then(response => {
                //console.log(response.data);
                const cols = [];
                const rows = [];
                response.data.columns.forEach((col,index)=>{
                    cols.push({
                        title: col,dataIndex:col.toLowerCase(),key:col.toLoweSrCase()
                        button: <button onClick={activateLasers}>  Activate Lasers
                        </button>

                    })
                });
                console.log(cols);
                response.data.data.forEach((row,index)=>{
                    let newRow = {key:index+1};
                    row.forEach((elem,index)=> {
                        //console.log(cols[index]);
                        newRow[cols[index].key] = elem;
                    });
                    rows.push(newRow);
                });
                console.log(rows);
                this.setState({
                    loading:false,notas:{
                        columns:cols,dataSource:rows
                    },deleted: false
                })
                console.log(this.state.notas.dataSource);
            })
            .catch(err => {
                this.setState({loading:false});
                console.log(err);
            });
    }

这是我要添加按钮的部分。感谢您的回答

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)