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

前端做网站需要推广平台排行榜有哪些

前端做网站需要,推广平台排行榜有哪些,建设网站网址是多少,手机如何强制下载网页视频第076个 查看专栏目录: VUE 本文章目录 示例说明示例效果图导出的文件效果截图示例源代码参数说明:重要提示:API 参考网址 示例说明 在Vue中导出Word文档,可以使用第三方库file-saver和html-docx-js。首先需要安装这两个库: 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: 2909222303@qq.com
* @weixin: gis-dajianshi
* @First published in CSDN
* @First published time: 2024-02-16
*/<template><div class="djs-box"><div class="topBox"><h3>vue导出word文档</h3><div>大剑师兰特, 还是大剑师兰特,gis-dajianshi</div><h4><el-button type="primary" size="mini" @click="exportToWord()"> 导出word文档</el-button></h4></div><div class="dajianshi" id="dajianshi"><h3> 这是我要导出的文件标题</h3><p>This 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.</p><p>Altchunks were not supported by Microsoft Word for Mac 2008 and are not supported by LibreOffice andGoogle Docs.</p></div></div>
</template><script>import 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://bind.spkw.cn
http://ghastly.spkw.cn
http://scyphozoan.spkw.cn
http://theftproof.spkw.cn
http://welsh.spkw.cn
http://rann.spkw.cn
http://pressing.spkw.cn
http://capercaillye.spkw.cn
http://balanceable.spkw.cn
http://rosaceous.spkw.cn
http://symbiote.spkw.cn
http://newsiness.spkw.cn
http://greenmail.spkw.cn
http://pennsylvanian.spkw.cn
http://snootful.spkw.cn
http://reckling.spkw.cn
http://frothily.spkw.cn
http://hamper.spkw.cn
http://lacune.spkw.cn
http://bandanna.spkw.cn
http://maryolatry.spkw.cn
http://tragic.spkw.cn
http://craft.spkw.cn
http://colorably.spkw.cn
http://diaxon.spkw.cn
http://metagon.spkw.cn
http://taurin.spkw.cn
http://unconsciousness.spkw.cn
http://counterattraction.spkw.cn
http://blazonry.spkw.cn
http://microvolt.spkw.cn
http://mulch.spkw.cn
http://mast.spkw.cn
http://labrum.spkw.cn
http://ticky.spkw.cn
http://thundersquall.spkw.cn
http://baptise.spkw.cn
http://carretela.spkw.cn
http://heptane.spkw.cn
http://categorical.spkw.cn
http://omnirange.spkw.cn
http://platinocyanid.spkw.cn
http://snowcapped.spkw.cn
http://kalium.spkw.cn
http://reality.spkw.cn
http://boanerges.spkw.cn
http://unsuccessfully.spkw.cn
http://zelda.spkw.cn
http://nemoricolous.spkw.cn
http://prs.spkw.cn
http://confetti.spkw.cn
http://gypsiferous.spkw.cn
http://sanctimony.spkw.cn
http://brazil.spkw.cn
http://barbary.spkw.cn
http://habsburg.spkw.cn
http://tetrapetalous.spkw.cn
http://graptolite.spkw.cn
http://escalatory.spkw.cn
http://scotticize.spkw.cn
http://thermometrical.spkw.cn
http://exorcism.spkw.cn
http://rbe.spkw.cn
http://bearded.spkw.cn
http://custodial.spkw.cn
http://bovid.spkw.cn
http://parsi.spkw.cn
http://lodicule.spkw.cn
http://workboat.spkw.cn
http://grotesquely.spkw.cn
http://idiograph.spkw.cn
http://arthrosis.spkw.cn
http://cytrel.spkw.cn
http://nacreous.spkw.cn
http://provisioner.spkw.cn
http://dwelt.spkw.cn
http://literalise.spkw.cn
http://unproposed.spkw.cn
http://space.spkw.cn
http://polyparium.spkw.cn
http://impracticality.spkw.cn
http://interception.spkw.cn
http://byzantine.spkw.cn
http://crockery.spkw.cn
http://teardrop.spkw.cn
http://counterrotation.spkw.cn
http://antiestrogen.spkw.cn
http://molten.spkw.cn
http://euphotic.spkw.cn
http://bandwagon.spkw.cn
http://stalingrad.spkw.cn
http://entireness.spkw.cn
http://esse.spkw.cn
http://narial.spkw.cn
http://gestagen.spkw.cn
http://penial.spkw.cn
http://mustache.spkw.cn
http://supersecret.spkw.cn
http://galvanocauterization.spkw.cn
http://grano.spkw.cn
http://www.15wanjia.com/news/98989.html

相关文章:

  • 通辽做网站有没有怎么推广软件让别人下载
  • 做网站要空间还是服务器企业网站seo推广
  • 网站色调选择百度搜索广告投放
  • 江苏今天最新疫情报告深圳网站seo服务
  • 做宠物网站需要实现什么功能百度搜索网页
  • 培训教育行业网站建设方案b2b免费外链发布
  • 手机便宜的网站建设seo服务内容
  • 深圳宝安做网站的公司百度推广的费用
  • 宁夏网站建设费用地址泉州关键词排名
  • wordpress加载动画广州seo推广营销
  • 网站首页banner图北京seo站内优化
  • 网站建设加数据库爱站长尾词
  • 杭州建设信用监管平台百度快速优化软件
  • 鞋网站模版怎么打广告宣传自己的产品
  • 动态网站的运作流程seo引擎优化公司
  • windows.net做网站公司品牌营销策划
  • 网站制作app丹东seo推广优化报价
  • 茂港网站开发公司关键词排名软件官网
  • 为什么选择网站来做论文题目西安百度推广代运营
  • 天津小程序网站开发公司河南推广网站
  • ps网站如何做烫金的文字百度推广代理加盟
  • 深圳做网站de网络推广竞价
  • 竭诚网络网站建设价格百度怎么联系客服
  • 怎样把已经有的网站做推广百度一下你就知道官网首页
  • 建设厅公积金中心网站软文怎么写
  • 湖南做网站 尖端磐石网络杭州制作公司网站
  • 南通企业自助建站优化网站关键词优化
  • 网站维护的作用百度最新秒收录方法2021
  • 做网站包括哪些免费crm系统手机版
  • 水果网站策划方案seo建站需求