vuejs导出excel设置字体,对齐,背景色

1446 ℃

xlsx基础版本不能设置样式,所有需要使用xlsx-style替代npm install –save xlsx

//引入XLSXStyle
import XLSXStyle from 'xlsx-style'

设置字体,对齐,背景色

let style = {
  // 表头样式
  header: { 
    font: { sz: 10, color: { rgb: "ff0000" }, bold: true },
    alignment: { horizontal: "center", vertical: "center", wrapText: true },
    fill: { bgColor: { indexed: 64 }, fgColor: { rgb: "FFFF00" }},
  },
  // 内容样式
  content: {
    font: { sz: 11 },
    alignment: { horizontal: "center", vertical: "center", wrapText: true },
  },
  // 注释行样式
  trips: {
    font: { sz: 10, bold: true },
    alignment: { vertical: "center", wrapText: true },
    fill: { bgColor: { indexed: 64 }, fgColor: { rgb: "00B050" }}
  }
};
sheet['A1'].s = style.header;

excel拆分单元格快捷键怎么用

如何利用PHPExcel类库建php将数据格式转为excel

Vue结合MVVM模型的实现方法

vuejs导入excel(多个Sheet表全部解析)

利用vue实现一个图片水平瀑布流效果

标签: excel, vue, 导出, 设置样式

上面是“vuejs导出excel设置字体,对齐,背景色”的全面内容,想了解更多关于 vuejs 内容,请继续关注web建站教程。

当前网址:https://m.ipkd.cn/webs_2113.html

声明:本站提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请发送到邮箱:admin@ipkd.cn,我们会在看到邮件的第一时间内为您处理!

php语法中mysql数据库如何实现链接、查询、插入、更新
Muse UI前端开源UI组件库文档官网介绍
如何解决dedecms未审核的文档的显示的问题
详解织梦模板DEDE首页列表页AJAX无限加载瀑布流修
vue实时监听浏览器大小变化重新渲染百度echarts