Author: Jiao_0805
link: https: //www.jianshu.com/p/dab03fb7d4e2
Source: Jane books
are copyrighted by the author. Commercial reprint please contact the author authorized, non-commercial reprint please indicate the source.
Npm import plug-in library
1.npm install exceljs
2. Individual extracting a feature component
3. The introduction of exceljs
4. Start line and codes
//create a workbook
var workbook = new Excel.Workbook();
//add header
var ws1 = workbook.addWorksheet(appName + "-" + base_type +type, {properties:{tabColor:{argb:'FFC0000'}}});
The individual cell is provided independently of the style
6. Data processing
7. Data Sheet added
8. The cell is provided hyperlink
9. Set the line width and other common style Gaohang
10. The introduction of functional modules
11.click event export excel
12. Effect