Commit c73597b9 by 周子尧

自定义表头实现

1 parent 2699c96b
......@@ -14,10 +14,12 @@ import selectMutiProDialog from '@/components/selectMutiProDialog/index.vue'
import selectSingleProDialog from '@/components/selectSingleProDialog/index.vue'
import relateStoreDialog from '@/components/relate-store-dialog'
import selectMutiProForcouponDialog from '@/components/selectMutiProDialog/indexForCoupon.vue'
import tableTooltip from '@/components/table-tooltip/index.vue'
Vue.component('glsx-combi-form', glsxCombiForm)
Vue.component('glsx-dialog', glsxDialog)
Vue.component('select-muti-pro-dialog', selectMutiProDialog)
Vue.component('select-single-pro-dialog', selectSingleProDialog)
Vue.component('relate-store-dialog', relateStoreDialog)
Vue.component('select-muti-pro-forcoupon-dialog', selectMutiProForcouponDialog)
\ No newline at end of file
Vue.component('select-muti-pro-forcoupon-dialog', selectMutiProForcouponDialog)
Vue.component('table-tooltip', tableTooltip)
\ No newline at end of file
<template>
<div class="table-tooltip">
<el-popover
placement="top"
width="200"
trigger="hover"
:content="content"
>
<el-button
slot="reference"
icon="el-icon-warning"
circle
></el-button>
</el-popover>
</div>
</template>
<script>
export default {
name: 'table-tooltip',
props: {
content: {
type: String,
default: ''
}
},
}
</script>
<style scope>
.table-tooltip {
padding-right: 0 !important;
}
.table-tooltip .el-button {
border: none !important;
}
.table-tooltip .el-button.is-circle {
padding: 0 !important;
}
.table-tooltip .el-button:focus,
.table-tooltip .el-button:hover {
background-color: transparent;
}
.table-tooltip .el-button:focus {
color: initial;
}
</style>
\ No newline at end of file
......@@ -213,8 +213,17 @@ export default {
}
},
{
label: '已核销成本/元',
// label: '已核销成本/元',
prop: 'verificationAnticipatedCost',
// sortable: true,
renderHeader: h => {
return h('div', { class: 'table-header' }, [
h('span', '已核销成本/元'),
h('table-tooltip', {
props: { content: '该商品的历史总销量,订单发生退款、换货历史销量均不变' }
})
])
},
formatter: cellValue => {
return cellValue.verificationAnticipatedCost / 100
}
......@@ -378,4 +387,11 @@ export default {
}
</script>
<style scoped></style>
<style scoped>
.table-header {
display: inline-flex !important;
align-items: center;
justify-content: center;
padding: 0 !important;
}
</style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!