当前位置: 首页 > news >正文

青之峰网站建设哪家好黑龙江新闻

青之峰网站建设哪家好,黑龙江新闻,免费wordpress XIU主题,h5制作多少钱第076个 查看专栏目录: VUE 本文章目录 示例说明示例效果图导出的文件效果截图示例源代码参数说明#xff1a;重要提示#xff1a;API 参考网址 示例说明 在Vue中导出Word文档#xff0c;可以使用第三方库file-saver和html-docx-js。首先需要安装这两个库#xff1a; npm … 第076个 查看专栏目录: VUE 本文章目录 示例说明示例效果图导出的文件效果截图示例源代码参数说明重要提示API 参考网址 示例说明 在Vue中导出Word文档可以使用第三方库file-saver和html-docx-js。首先需要安装这两个库 npm install file-saver html-docx-js --save 然后在Vue组件中使用这两个库来导出Word文档 示例效果图 导出的文件效果截图 示例源代码 /* * Author: 大剑师兰特xiaozhuanlan还是大剑师兰特CSDN * 此源代码版权归大剑师兰特所有可供学习或商业项目中借鉴未经授权不得重复地发表到博客、论坛问答git等公共空间或网站中。 * Email: 2909222303qq.com * weixin: gis-dajianshi * First published in CSDN * First published time: 2024-02-16 */templatediv classdjs-boxdiv classtopBoxh3vue导出word文档/h3div大剑师兰特, 还是大剑师兰特gis-dajianshi/divh4el-button typeprimary sizemini clickexportToWord() 导出word文档/el-button/h4/divdiv classdajianshi iddajianshih3 这是我要导出的文件标题/h3pThis is a very small library that is capable of converting HTML documents to DOCX format that is used byMicrosoft Word 2007 and onward. It manages to perform the conversion in the browser by using a featurecalled altchunks. In a nutshell, it allows embedding content in a different markup language. We areusing MHT document to ship the embedded content to Word as it allows to handle images. After Word openssuch file, it converts the external content to Word Processing ML (this is how the markup language ofDOCX files is called) and replaces the reference./ppAltchunks were not supported by Microsoft Word for Mac 2008 and are not supported by LibreOffice andGoogle Docs./p/div/div /templatescriptimport FileSaver from file-saver;import htmlDocx from html-docx-js/dist/html-docx;export default {data() {return {message: hello world,price: 1234.56,date: 2022-01-01}},methods: {exportToWord() {// 获取要导出的HTML内容const content document.getElementById(dajianshi).innerHTML;// 将HTML内容转换为Word文档const converted htmlDocx.asBlob(content);// 使用FileSaver保存Word文档FileSaver.saveAs(converted, example.docx);},},} /script style scoped.djs-box {width: 1000px;height: 650px;margin: 50px auto;border: 1px solid deepskyblue;}.topBox {margin: 0 auto 0px;padding: 10px 0 20px;background: deepskyblue;color: #fff;}.dajianshi {width: 93%;height: 400px;margin: 5px auto 0;border: 1px solid #369;background-color: cde;padding: 20px;}p {font-size: 16px;text-align: left;} /style 参数说明 要生成 DOCX只需将 HTML 文档作为字符串传递给 asBlob 方法以接收包含输出文件的 Blob或缓冲区。 var converted htmlDocx.asBlob(content); saveAs(converted, ‘test.docx’); asBlob 可以采用其他选项来控制文档的页面设置 orientation: landscape or portrait (default) margins: map of margin sizes (expressed in twentieths of point, see WordprocessingML documentation for details): top: number (default: 1440, i.e. 2.54 cm) right: number (default: 1440) bottom: number (default: 1440) left: number (default: 1440) header: number (default: 720) footer: number (default: 720) gutter: number (default: 0) 重要提示 please pass a complete, valid HTML (including DOCTYPE, html and body tags). This may be less convenient, but gives you possibility of including CSS rules in style tags. html-docx-js is distributed as ‘standalone’ Browserify module (UMD). You can require it as html-docx. If no module loader is available, it will register itself as window.htmlDocx. See test/sample.html for details. API 参考网址 https://www.npmjs.com/package/html-docx-js
http://www.dnsts.com.cn/news/17337.html

相关文章:

  • 中国农村建设网站首页新乡营销型网站
  • 深圳戈麦斯网站开发个人博客网站怎么赚钱
  • 广州网站公司建设宁德seo公司
  • 在线作图网站沧县网站建设
  • 买的有域名怎么做网站中国机械网官网
  • 做动车哪个网站查WordPress简约主题开源
  • 网站设计公司 国际什么是网络营销的综合工具
  • 网站开发任务完成情况景点介绍网站开发设计
  • 做整形网站多少钱小型私人会所装修设计
  • 怎么做可上传图片的网站腾讯企业邮箱登录入口免费版
  • 苏州高端网站开发德阳建设网站的公司
  • 养殖网站 模板郴州做网站的公司
  • 建设网站公司需要准备哪些材料可以做3d电影网站
  • 网站推广淘宝联盟怎么做郑州男科医院怎么样啊
  • 网站如果不备案吗网站工作室模板
  • 个人空间网站模板珠海百度seo公司
  • php网站制作 青岛wordpress.org教程
  • 淘宝联盟网站推广怎么做深圳宝安高端网站建设报价
  • 英文网站设计多少钱如何在自己做的网站中顶置内容
  • 网上推广网站手机网站域名绑定
  • 滁州做网站的建设网站公司管备案么
  • 网站建设服务哪便宜贵阳企业网站模板
  • 建站工具有哪些网站建设需要怎么做
  • php制作网站建筑网站 法人签字
  • 为何网站建设公司报价不同自己做网站还是开通阿里巴巴诚信通
  • 网站模板怎么做视频教程电商网站排行榜
  • 制作网站花都wordpress恢复老版本
  • 做电影网站如何不侵权wordpress 登陆 插件
  • 网站建设3lue优化设计六年级上册答案
  • 获取网站访客qq号码阿里巴巴国际站费用