javascript - antDesign的table column最后一次加載的時候this是undefined 怎么回事
問題描述
const { mode, status, startDate, endDate, keyword, payStatus, sellerDistributorId,showBatchAdd,selectedRowKeys} = this.state;const modelType = window.sessionStorage.getItem(’NAV_TYPE’) || ’UP’;//上游模式的Columnsconst upModeColumns = [{ title: ’訂單號’, dataIndex: ’code’}, { title: ’下單日期’, dataIndex: ’orderDate’, //className: ’column-time’, //render(text) { // return new Date(Number(text)).Format('YYYY-MM-dd hh:mm'); //},}, { title: ’客戶名稱’, dataIndex: ’sellerDistributorName’,}, { title: ’訂單類型’, dataIndex: ’typeStr’, render(data, row, index) {return <span>{row.upTypeStr}</span> }}, { title: ’總金額’, dataIndex: ’totalPrice’}, { title: ’已收款’, dataIndex: ’paidFund’},{ title: ’訂單狀態’, dataIndex: ’statusStr’, render(data, row, index) {//訂購單,狀態為'新建'的訂單,顯示為'待審核'. 并且標紅顯示return <span style={ row.status == 1? { color: ’red’} : null}>{ row.status == 1? '待審核' : row.statusStr}</span> }}, { title: ’付款狀態’, dataIndex: ’payStatusStr’, render: (data, row) => {let style = row.payStatus == 1? {color: ’red’} : null;return <span style={style}>{row.payStatusStr}</span> },}, { title: ’操作’, dataIndex: ’operation’, // fixed: ’right’, // width: 100, render(data, row, index) {const idUrl = `/orderDetail/${row.id}/${row.type}`;return <span className='operation'> <Popconfirm placement='left' title=’確定要完成收款嗎?’ onConfirm={this.handleFinishFlow.bind(this, row.id,row)}><a href='javascript:void(0)'>完成</a> </Popconfirm> <Link to={idUrl}>詳情</Link> </span> }}];
為什么column的this是undefined呢?
問題解答
回答1:并不知道你的handleFinishFlow是怎么寫的,可以把onConfirm={this.handleFinishFlow.bind(this, row.id,row)} 改成 onConfirm={()=>this.handleFinishFlow(row.id,row)}試試看
相關文章:
1. java - 如何在Fragment中調用Activity的onNewIntent?2. python - (初學者)代碼運行不起來,求指導,謝謝!3. python的文件讀寫問題?4. mysql里的大表用mycat做水平拆分,是不是要先手動分好,再配置mycat5. javascript - jquery hide()方法無效6. javascript - js 對中文進行MD5加密和python結果不一樣。7. javascript - 圖片鏈接請求一直是pending狀態,導致頁面崩潰,怎么解決?8. window下mysql中文亂碼怎么解決??9. python - 獲取到的數據生成新的mysql表10. javascript - h5上的手機號默認沒有識別
