文档:https://www.npmjs.com/package/mhtml-to-word
/* * @Description: * @Author: pang bo * @Date: 2021-06-28 10:40:21 * @LastEditTime: 2021-06-28 11:06:18 * @LastEditors: Do not edit */import React from 'react' import { Button } from 'antd'; import { exportWord } from 'mhtml-to-word' export default function Index() { const exportExcelClick = () => { // var model = ` // <div> // <% for(var i = 0 ; i < 10 ; i++){ %> // <span><%=title%></span> // </div> // ` // exportWord({ // mhtml: model, // data: { title: "exportword" }, // filename: "exportTest", // style: "span{ font-size:30px; }" // }) exportWord({ selector: ".word-name", style: "h3{font-size: 30px; color: red;text-align:center}", filename: "exportTest" }) } return ( <div> <Button type="primary" onClick={exportExcelClick}>导出world</Button> <div className='word-name'> <h3>132132</h3> </div> </div> ) }
发表评论
侧栏公告
寄语
譬如朝露博客是一个分享前端知识的网站,联系方式11523518。
热评文章
标签列表
热门文章
友情链接