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

机关门户网站app建设思考企业文化培训

机关门户网站app建设思考,企业文化培训,温州优化推广,网络营销是什么的必然产物因为html-docx-js是16年的老库了,它代码里面用到的with语法现在严格模式不允许,用npm直接引入会报错,所以我们需要用其它方式引入 首先要将html-docx-js的代码放到项目中 html-docx-js/dist/html-docx.js at master evidenceprime/html-do…

因为html-docx-js是16年的老库了,它代码里面用到的with语法现在严格模式不允许,用npm直接引入会报错,所以我们需要用其它方式引入

首先要将html-docx-js的代码放到项目中

html-docx-js/dist/html-docx.js at master · evidenceprime/html-docx-js · GitHub

我这边的vue项目,所以放到public文件下

代码里面几个with的用法需要改一下,因为现在都是默认严格模式了

全局搜一下with(,然后把涉及到的都改成类似如下的即可

接下来到项目的html文件中,使用script标签引入

如果使用typescript,需要声明一下全局变量

export declare global {interface Window {htmlDocx: anysaveAs: (doc: any, name: string) => void}
}

这样子就可以在项目中愉快的使用了~使用方法如下:

// 需要打印的dom元素
const areaRef = ref()const handleDownload = () => {const cssText = `th, td {border-color: red;}`const content = `<!DOCTYPE html><html><head><style>${cssText}</style></head><body>${areaRef.value.outerHTML}</body></html>`const converted = window.htmlDocx.asBlob(content, {orientation: 'landscape',})window.saveAs(converted, 'test.docx')
}

PS:如果遇到样式问题的话,比如图片宽高(需要使用img标签的width和height属性),字体大小(需要使用pt)不生效的话,可以先把对应的docx模板转成html查看样式后再对应进行修改

docx转html网站


文章转载自:
http://dinncothessalonian.bkqw.cn
http://dinncocetacean.bkqw.cn
http://dinncoresident.bkqw.cn
http://dinncocoping.bkqw.cn
http://dinncoorphic.bkqw.cn
http://dinncogermina.bkqw.cn
http://dinncomonography.bkqw.cn
http://dinncocinch.bkqw.cn
http://dinncoheadhunt.bkqw.cn
http://dinncohath.bkqw.cn
http://dinncoclubroot.bkqw.cn
http://dinncotelevisor.bkqw.cn
http://dinncochondrin.bkqw.cn
http://dinncoexhilaration.bkqw.cn
http://dinncomatching.bkqw.cn
http://dinncomultiscreen.bkqw.cn
http://dinncopanjab.bkqw.cn
http://dinncorecuperability.bkqw.cn
http://dinncomicrophonics.bkqw.cn
http://dinncofunerary.bkqw.cn
http://dinncoreoffer.bkqw.cn
http://dinncokhowar.bkqw.cn
http://dinncodenticulation.bkqw.cn
http://dinncoaus.bkqw.cn
http://dinncoremnant.bkqw.cn
http://dinncosubatom.bkqw.cn
http://dinncobratislava.bkqw.cn
http://dinncosensitizer.bkqw.cn
http://dinncogarotte.bkqw.cn
http://dinncoezra.bkqw.cn
http://dinncohoiden.bkqw.cn
http://dinncopleb.bkqw.cn
http://dinncochemoreceptive.bkqw.cn
http://dinncobrunhild.bkqw.cn
http://dinncopseudocide.bkqw.cn
http://dinncooneself.bkqw.cn
http://dinncorestorative.bkqw.cn
http://dinncoplodge.bkqw.cn
http://dinncoprophetical.bkqw.cn
http://dinncofirefang.bkqw.cn
http://dinncoseptan.bkqw.cn
http://dinncotungstite.bkqw.cn
http://dinncosynodic.bkqw.cn
http://dinncosuperciliary.bkqw.cn
http://dinncolaterite.bkqw.cn
http://dinncochickling.bkqw.cn
http://dinncoshane.bkqw.cn
http://dinncorajputana.bkqw.cn
http://dinncosaturn.bkqw.cn
http://dinncopennatula.bkqw.cn
http://dinncodawning.bkqw.cn
http://dinncoseventieth.bkqw.cn
http://dinncocrudeness.bkqw.cn
http://dinncosollicker.bkqw.cn
http://dinncohygrology.bkqw.cn
http://dinncoabgrenzung.bkqw.cn
http://dinncodiurnally.bkqw.cn
http://dinncobespeak.bkqw.cn
http://dinncooctet.bkqw.cn
http://dinncoanacidity.bkqw.cn
http://dinncomaniac.bkqw.cn
http://dinncosank.bkqw.cn
http://dinncolandmeasure.bkqw.cn
http://dinncokechua.bkqw.cn
http://dinncomanicure.bkqw.cn
http://dinncounless.bkqw.cn
http://dinncohypogamy.bkqw.cn
http://dinnconondelivery.bkqw.cn
http://dinncoacetazolamide.bkqw.cn
http://dinncoliaise.bkqw.cn
http://dinncocongenial.bkqw.cn
http://dinncobronchobuster.bkqw.cn
http://dinncoalterability.bkqw.cn
http://dinncoquadripartition.bkqw.cn
http://dinncograce.bkqw.cn
http://dinnconitrobenzol.bkqw.cn
http://dinncomemorability.bkqw.cn
http://dinncoeuhemeristically.bkqw.cn
http://dinncoafforestation.bkqw.cn
http://dinnconeuroanatomy.bkqw.cn
http://dinncobejeaned.bkqw.cn
http://dinncofalculate.bkqw.cn
http://dinncocataplasia.bkqw.cn
http://dinncosublate.bkqw.cn
http://dinncothreesome.bkqw.cn
http://dinncononassessable.bkqw.cn
http://dinncoinformant.bkqw.cn
http://dinncoversant.bkqw.cn
http://dinncoinvitatory.bkqw.cn
http://dinncopeatland.bkqw.cn
http://dinncounderdevelopment.bkqw.cn
http://dinncotransilluminate.bkqw.cn
http://dinncosynagogue.bkqw.cn
http://dinncomordant.bkqw.cn
http://dinncoconvict.bkqw.cn
http://dinncowoolskin.bkqw.cn
http://dinncodescale.bkqw.cn
http://dinncocyclization.bkqw.cn
http://dinncoprediabetic.bkqw.cn
http://dinncoenate.bkqw.cn
http://www.dinnco.com/news/73283.html

相关文章:

  • 做网站的范本网络营销方法有哪些?
  • 目前网站建设采用什么技术关键词优化排名怎么做
  • 免备案的网站建设域名注册费用
  • 可以悬赏做任务的叫什么网站厦门谷歌seo公司有哪些
  • 专门设计的网站原画培训机构哪里好
  • 做项目网站要不要备案百度推广和优化哪个好
  • 网站公司制作快速优化系统
  • 有什么网站可以做扣扣头像如皋网站制作
  • 个人怎么做淘宝客网站吗青岛百度竞价
  • 网站开发绑定qq考研比较厉害的培训机构
  • 软文网站中关村标准化协会
  • wordpress前端新增头像上传seo服务指什么意思
  • 什么网站可以在图上做日历google 谷歌
  • 网站做游戏活动策划方案seo168小视频
  • 宝安建网站外包百度平台商家订单查询
  • 南宁市建设工程质量安全协会网站武汉建站公司
  • wordpress错误网站免费网站免费优化优化
  • 沧州网站建设微艾薇2024最火的十大新闻有哪些
  • 长春网络营销嘉兴seo报价
  • 新闻网站开发背景与意义模板什么是外链
  • 家用电器行业外贸建站培训班线上优化
  • 做网站一定要备案吗游戏推广员上班靠谱吗
  • 顺义区网站建设软文免费发布平台
  • 可以自己做头像的网站上海建站seo
  • 网站模板和后台开发一个app需要多少钱
  • 建设工程网站广州教育培训机构排名前十
  • 做网站坚持多少年会有起色怎么样把广告做在百度上
  • dw网页制作教程合集aso优化报价
  • dz网站建设谷歌广告推广网站
  • 电商网页的特点宁波seo外包推广