antd vue table實現(xiàn)跨行合并單元格并自定義內(nèi)容實例?相信很多沒有經(jīng)驗的人對此束手無策,為此本文總結(jié)了問題出現(xiàn)的原因和解決方法,通過這篇文章希望你能解決這個問題。
濱海ssl適用于網(wǎng)站、小程序/APP、API接口等需要進行數(shù)據(jù)傳輸應(yīng)用場景,ssl證書未來市場廣闊!成為創(chuàng)新互聯(lián)的ssl證書銷售渠道,可以享受市場價格4-6折優(yōu)惠!如果有意向歡迎電話聯(lián)系或者加微信:13518219792(備注:SSL證書合作)期待與您的合作!源碼:
export default { data() { return { pic95: require('@/assets/produit/95.png'), pic99: require('@/assets/produit/99.png'), varTable: { cloumns: [ { title: '置信度', dataIndex: 'confidence ', class: 'confidence', customRender: (value, row, index) => { let obj = { children: '', attrs: {} } if (index === 0) { obj = { children: <div class="risk-pic"><img src={this.pic95} /></div>, attrs: { rowSpan: 4 } } } if (index === 4) { obj = { children: <div class="risk-pic"><img src={this.pic99} /></div>, attrs: { rowSpan: 4 } } } if ([1, 2, 3, 5, 6, 7].indexOf(index) !== -1) { obj.attrs.colSpan = 0 } return obj } }, { title: '天數(shù)', dataIndex: 'window_length', width: '25%', customRender: (text) => text + '日' }, { title: 'VaR(萬元)', dataIndex: 'var', width: '25%' }, { title: 'VaR/凈資產(chǎn)', dataIndex: 'var_rate', width: '25%', customRender: (text) => fmtRatio(text, 2) } ], data: [ {window_length: 1, var: 151.69, var_rate: 0.01858}, {window_length: 5, var: 298.94, var_rate: 0.03661}, {window_length: 10, var: 416.70, var_rate: 0.05104}, {window_length: 20, var: 576.04, var_rate: 0.07055}, {window_length: 1, var: 370.64, var_rate: 0.045398}, {window_length: 5, var: 463.33, var_rate: 0.056751}, {window_length: 10, var: 632.91, var_rate: 0.077523}, {window_length: 20, var: 1233.95, var_rate: 0.15114} ] } } }, methods:{ // 百分數(shù)設(shè)置 fmtRatio(val, index, def) { // index默認值為2 var index = arguments[1] ? arguments[1] : 2 if (val == null || isNaN(val) || typeof (val) === 'string' && val === '') { return def || '--' } var ratio = (val * 100).toFixed(index) return ratio + '%' } } }
分享文章:antdvuetable實現(xiàn)跨行合并單元格并自定義內(nèi)容實例-創(chuàng)新互聯(lián)
地址分享:http://aaarwkj.com/article36/cchdsg.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站建設(shè)、商城網(wǎng)站、微信小程序、小程序開發(fā)、企業(yè)網(wǎng)站制作、電子商務(wù)
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)
猜你還喜歡下面的內(nèi)容