1.html
<el-table-column prop="taxes" :render-header="renderheader" width="180"> <template slot-scope="scope">{{scope.row.taxes}}</template> </el-table-column>
2.js
renderheader(h, { column, $index }) { // console.log(column, $index) // console.log(this.addedvaluetaxrate, this.additionaltaxrate) let addedvaluetaxrate = this.addedvaluetaxrate // 6 let additionaltaxrate = this.additionaltaxrate // 0.8 return [ '税费', h( 'el-tooltip', { props: { content: (function() { return `含增值说${addedvaluetaxrate}%,附加税${additionaltaxrate}%` })(), placement: 'top' } }, [ h('span', { class: { 'el-icon-question': true } }) ] ) ] }
3.亲测有效,在代码中正在使用
4.效果图
如对本文有疑问, 点击进行留言回复!!
解决vue 项目使用webpack打包后,直接打开dist文件夹下的页面空白的问题
vscode写vue代码时常用格式化设置,解决格式化函数名后空格消失问题等...
网友评论