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;
以上是编程学习网小编为您介绍的“vuejs导出excel设置字体,对齐,背景色”的全面内容,想了解更多关于 vuejs 内容,请继续关注编程基础学习网。
沃梦达教程
本文标题为:vuejs导出excel设置字体,对齐,背景色


猜你喜欢
- vuejs封装60秒倒计时 2024-12-07
- Div+CSS 布局入门教程之二 构建网站 2024-02-07
- css语法自动换行代码介绍(word-break和white-space) 2024-12-13
- 微信小程序实现自定义底部导航 2023-12-22
- Vue为什么要用JSX?语法介绍 2025-01-14
- data-参数说明(模态弹出窗的使用) 2022-11-02
- vue3.0之Router的使用你了解吗 2024-03-09
- JS 加载性能Tree Shaking优化详解 2024-01-15
- 基于React路由跳转的几种方式 2024-03-09
- HTML+CSS制作心跳特效的实现 2022-09-20