ffcs-xtx-watermark
Project setup
npm install ffcs-xtx-watermark
Compiles and hot-reloads for development
npm run serve
Compiles and minifies for production
npm run build
Customize configuration
See Configuration Reference.
界面添加水印,导出excel、添加excel水印
引入
import watermark from 'excelwatermark'
界面设置水印方法参数介绍
wmParams: 水印参数 | Object
debounce: 是否加防抖(窗口大小调整触发) | Boolean (可不传)
使用方法
wmParams: {
wmStr: '水印内容' // 需要展示的水印信息
width: 500, // 展示水印区域的宽度
height: 400, // 展示水印区域的高度
rotate: -60, // 水印的旋转度数
initX: 0, // 水印在该区域的起始X坐标
initY: 400, // 水印在该区域的起始Y坐标
fillColor: 'rgba(130, 142, 162, 0.2)', // 水印填充颜色
font: 'Vedana', // 水印字体
fontSize: 18 // 水印大小
}
watermark.exportExcel(headList, dataArr, fileName, wmParams, sheetName)
导出excel方法参数介绍
headList: 表格名称 | Object
dataArr: 数据 | Array
fileName: 文件名称 | String
wmParams: 水印参数 | Object
sheetName: sheet名称 | String (可不传)
headList: {
colunm1: '列1',
colunm2: '列2',
colunm3: '列3',
colunm4: '列4'
}
dataArr: [{
colunm1: '列1数据',
colunm2: '列2数据',
colunm3: '列3数据',
colunm4: '列4数据'
}]
使用方法
wmParams: {
wmStr: '水印内容' // 需要展示的水印信息
width: 200, // 展示水印区域的宽度
height: 300, // 展示水印区域的高度
rotate: -30, // 水印的旋转度数
initX: -100, // 水印在该区域的起始X坐标
initY: 200, // 水印在该区域的起始Y坐标
fillColor: 'rgba(130, 142, 162, 0.2)', // 水印填充颜色
font: 'Vedana', // 水印字体
fontSize: 18 // 水印大小
}
watermark.exportExcel(headList, dataArr, fileName, wmParams, sheetName)