Vue project + element table front end uses pure js to export word documents

 For details, please read https://www.jianshu.com/p/0de31429b12a this article

 First install various tools:

-- 安装 docxtemplater
cnpm install docxtemplater pizzip  --save

-- 安装 jszip-utils
cnpm install jszip-utils --save 

-- 安装 jszip
cnpm install jszip --save

-- 安装 FileSaver
cnpm install file-saver --save

 Then import it in the required file

 Create a new word document, typeset the format, fill in the value in {name} format, and place it in the static directory.

 Front-end html:

Data:

method:

 effect:

 

Guess you like

Origin blog.csdn.net/qq_41588568/article/details/103683660
Recommended