antd-design-vue的table中获取到其他列的数据,并添加样式
获取其他列的数据{title: '价格(元)',align: "center",dataIndex: '',scopedSlots: { customRender: 'price' },// customRender: (text, record) => {//if (record.priceType == '1') {//return record.price;//} else .
·
获取其他列的数据 { title: '价格(元)', align: "center", dataIndex: '', scopedSlots: { customRender: 'price' }, // customRender: (text, record) => { // if (record.priceType == '1') { // return record.price; // } else if (record.priceType == '2') { // return record.price + " - " + record.price2; // } else if (record.priceType == '3') { // ... // } // } },
若要添加样式
{ title: '价格(元)', align: "center", dataIndex: '', scopedSlots: { customRender: 'price' } },
在a-table中
<a-table ref="table" size="middle" bordered rowKey="id" :columns="columns" :dataSource="tableList" :pagination="ipagination" :loading="loading" class="j-table-force-nowrap" :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" @change="handleTableChange">
<span slot="price" slot-scope="text, record"> <span v-if="record.priceType == '1'"> <span>{{record.price}}</span> </span> <span v-if="record.priceType == '2'"> {{record.price}} - {{record.price2}} </span> <span v-if="record.priceType == '3'"> <span style="text-decoration:line-through">{{record.price}}</span>(原价) {{record.price2}}(现价) </span> </span>
效果图:
更多推荐
已为社区贡献7条内容
所有评论(0)