vue-print-nb 打印el-tabel表格时border不显示问题

一、指定打印元素
I. Specify print elements
1. Print object
<div id="printid">
这里是要打印的东西
</div>
<!--通过 v-print 调用打印事件 -->
<button v-print="printObj">打印</button>
export default {
    data() {
      return {
         printObj: {
          id: "printid",    // 这里是要打印元素的ID
          popTitle: '',  // 打印的标题
          extraCss: '',  // 打印可引入外部的一个 css 文件
          extraHead: ''  // 打印头部文字
        },
      } 
    }
}

二、打印时tabel表格边框不显示,是因为print打印时不会打印原有的表格样式,需要重新用样式覆盖之前的css样式即可

Second, the tabel table border is not displayed when printing, because the original table style will not be printed when printing, you need to overwrite the previous CSS style with the style

2. CSS style


/*去除页脚*/
  @page{
    size:  auto;  
    margin-bottom: 0mm; //去掉页脚
  }
/* 打印el-tabel表格的样式时表格边框不显示*/
.el-tabel--mini .el-tabel__cell{
 border :1px solid red !important;
}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值