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

医院网站运营方案欧美网站建设教程

医院网站运营方案,欧美网站建设教程,昆明有多少做网站的公司,湘潭网站建站公司提示#xff1a;word预览方式—插件 文章目录 [TOC](文章目录) 前言一、vue-office-docx把docx转换html二、调取window.print三、print-js四、vue-print-nb总结 前言 word预览 一、vue-office-docx把docx转换html npm install vue-office-docx -S-DofficeDocx.vue templ… 提示word预览方式—插件 文章目录 [TOC](文章目录) 前言一、vue-office-docx把docx转换html二、调取window.print三、print-js四、vue-print-nb总结 前言 word预览 一、vue-office-docx把docx转换html npm install vue-office-docx -S-DofficeDocx.vue templatediv classpreview_boxVueOfficeDocx :srchtmlContent/VueOfficeDocx/div/templatescriptimport axios from axiosimport VueOfficeDocx from vue-office/docx//引入相关样式import vue-office/docx/lib/index.css;export default {name: preview,components:{VueOfficeDocx},data () {return {src:.docx文件rul,htmlContent:}},mounted(){this.docToHtml();},methods: {docToHtml(){axios.get(this.src,{ responseType: arraybuffer }).then((res){this.htmlContent res.data;})}}}/scriptstyle scoped/style 样式还原度一般间距太大分页也有问题 二、调取window.print officeDocx.vue templatediv classpreview_box div classpreview_print_btn clickprintHTML打印/divdiv refprintBoxRefVueOfficeDocx :srchtmlContent/VueOfficeDocx/div/div/templatescriptimport axios from axiosimport VueOfficeDocx from vue-office/docx//引入相关样式import vue-office/docx/lib/index.css;export default {name: preview,components:{VueOfficeDocx},data () {return {src:https://iteachcdn.test.xdf.cn/doc/111f92d3d71f471db47a4cb88b425d71.docx,// src:.docx文件rul,htmlContent:}},mounted(){this.docToHtml();},methods: {docToHtml(){axios.get(this.src,{ responseType: arraybuffer }).then((res){this.htmlContent res.data;})},printHTML(){// 新建窗口const win window.open(,_blank);// 把要打印的html写入新窗口win.document.write(this.$refs.printBoxRef.innerHTML);// 调起浏览器打印win.window.print();// 关闭新窗口win.window.close(); },}}/script style scoped .preview_print_btn{height: 32px;line-height: 32px;background: #0e7a38;color: #fff;text-align: center; } /style预览有问题打印也有问题 三、print-js npm install print-js -S-DofficeDocx.vue templatediv classpreview_box div classpreview_print_btn clickprintHTML打印/divdiv refprintBoxRefVueOfficeDocx :srchtmlContent/VueOfficeDocx/div/div/templatescriptimport axios from axiosimport VueOfficeDocx from vue-office/docx//引入相关样式import vue-office/docx/lib/index.css;import printJS from print-jsexport default {name: preview,components:{VueOfficeDocx},data () {return {src:https://iteachcdn.test.xdf.cn/doc/111f92d3d71f471db47a4cb88b425d71.docx,// src:.docx文件rul,htmlContent:}},mounted(){this.docToHtml();},methods: {docToHtml(){axios.get(this.src,{ responseType: arraybuffer }).then((res){this.htmlContent res.data;})},printHTML(){printJS({printable: this.$refs.printBoxRef,type: html,targetStyles: [*]}); },}}/script style scoped .preview_print_btn{height: 32px;line-height: 32px;background: #0e7a38;color: #fff;text-align: center; } /style打印样式相对好一些但是分页有问题 四、vue-print-nb npm install vue-print-nb -S-DofficeDocx.vue templatediv classpreview_box div classpreview_print_btn v-printprintobj打印/divdiv idprintBox refprintBoxRefVueOfficeDocx :srchtmlContent/VueOfficeDocx/div/div/templatescriptimport axios from axiosimport VueOfficeDocx from vue-office/docx//引入相关样式import vue-office/docx/lib/index.css;import Print from vue-print-nb;export default {name: preview,components:{VueOfficeDocx},data () {return {src:.docx文件rul,htmlContent:,printobj: {id: printBox,popTitle: 标题,extraCss: https://cdn.bootcdn.net/ajax/libs/animate.css/4.1.1/animate.compat.css, https://cdn.bootcdn.net/ajax/libs/hover.css/2.3.1/css/hover-min.css,extraHead: meta http-equivcontent-language contentzh-cn /,beforeOpenCallback(vue) {console.log(调起打印弹窗之前);},openCallback(vue) {console.log(调起打印弹窗);}}}},directives: { Print },mounted(){this.docToHtml();},methods: {docToHtml(){axios.get(this.src,{ responseType: arraybuffer }).then((res){this.htmlContent res.data;})},}}/script style scoped .preview_print_btn{height: 32px;line-height: 32px;background: #0e7a38;color: #fff;text-align: center; } media print {page {size: auto;margin: 3mm;}body {height: auto;} } /style打印样式也有问题 综上word转html后进行打印方式存再问题不建议使用 总结 踩坑路漫漫长~
http://www.hkea.cn/news/14291212/

相关文章:

  • 先做网站 先备案公司的网络拓扑图
  • 西维科技做网站怎么样网站域名解析设置
  • 中国空间站简介100字汕头网站快速排名
  • 计算机系部网站开发背景电商网站建设用php
  • 做电商在什么网站seo技术论坛
  • 国外炫酷网站欣赏网站加强队伍建设
  • python+网站开发实例教程外贸公司取什么名字好
  • 网站开发需求目标椒江住房和城乡建设规划局网站
  • 公司网站策划书佛山网站建设公司-印象互动
  • 网站内容建设总结网站建设分析报告
  • 手机怎样做网站图解网上商城建设公司
  • 通过域名打开网站是做映射么海外网站推广
  • 中天建设中瑞物资网站wordpress 极简 h5
  • 有网站吗免费的安全的集团网站建设
  • 怎么用iapp做网站软件镇江网站建站
  • 3合1网站建设电话建设工程敎育网网站
  • 怎样下载别人网站自己做的视频书店网站建设个人总结
  • 智能响应式网站建设武隆网站建设
  • 网站建设费分录服务器网站部署
  • 做电脑系统那个网站好点设计师图片素材网站有哪些
  • 完整域名展示网站源码网站子域名 更换
  • 雄县做网站网站访问量js
  • 网站的建设过程织梦网站是不是容易做seo
  • 怎样做_网站做seo促销方法100种
  • 凤岗仿做网站南京制作网页速成班
  • 网站建设选亿企网络创意设计网站
  • 怎样取消网站备案深圳的网站建设公司那家好
  • 常德建设网站制作微信做明天展现网站要多少钱
  • 仿站 flash网站qq是用什么开发的
  • wordpress 网站白屏电机东莞网站建设