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

html如何做网站计算机培训课程

html如何做网站,计算机培训课程,小学生ppt模板免费下载,常州网站建设公司如何概述 在做项目的时候会遇到docx、xlsx、pdf等文件的在线预览需求,实现此需求可以有多种解决方式,本文基于vue-office实现纯前端的文件预览。 效果 如下图,分别为docx、xlsx、pdf三种类型的文件在线加载后的效果。你也可以访问官方预览网址…

概述

在做项目的时候会遇到docxxlsxpdf等文件的在线预览需求,实现此需求可以有多种解决方式,本文基于vue-office实现纯前端的文件预览。

效果

如下图,分别为docxxlsxpdf三种类型的文件在线加载后的效果。你也可以访问官方预览网址查看效果。
image.png

实现

1. 添加依赖

package.json文件中添加如下依赖,并通过命令npm i安装依赖。

{...,"dependencies": {"@vue-office/docx": "1.6.0","@vue-office/excel": "1.6.0","@vue-office/pdf": "1.6.0"},
}

2. 引入依赖

vue文件中引入依赖,示例代码如下:

//引入相关样式
import '@vue-office/docx/lib/index.css'
import '@vue-office/excel/lib/index.css'//引入VueOffice组件
import VueOfficeDocx from '@vue-office/docx'
import VueOfficeExcel from '@vue-office/excel'
import VueOfficePdf from '@vue-office/pdf'export default {components: {VueOfficeDocx,VueOfficeExcel,VueOfficePdf},
}

3. 使用组件

<template><div class="layout-file"><div class="layout-file-title">{{docx}}</div><vue-office-docx :src="docx" @rendered="rendered"/></div><div class="layout-file"><div class="layout-file-title">{{excel}}</div><vue-office-excel :src="excel" @rendered="rendered"/></div><div class="layout-file"><div class="layout-file-title">{{pdf}}</div><vue-office-pdf style="height: 100%;" :src="pdf" @rendered="rendered"/></div>
</template>

完整的实现代码如下:

<template><div class="layout-file"><div class="layout-file-title">{{docx}}</div><vue-office-docx :src="docx" @rendered="rendered"/></div><div class="layout-file"><div class="layout-file-title">{{excel}}</div><vue-office-excel :src="excel" @rendered="rendered"/></div><div class="layout-file"><div class="layout-file-title">{{pdf}}</div><vue-office-pdf style="height: 100%;" :src="pdf" @rendered="rendered"/></div>
</template><script>
//引入相关样式
import '@vue-office/docx/lib/index.css'
import '@vue-office/excel/lib/index.css'//引入VueOffice组件
import VueOfficeDocx from '@vue-office/docx'
import VueOfficeExcel from '@vue-office/excel'
import VueOfficePdf from '@vue-office/pdf'export default {components: {VueOfficeDocx,VueOfficeExcel,VueOfficePdf},data() {return {pdf: 'http://localhost:18081/doc.pdf',excel: 'http://localhost:18081/doc.xlsx',docx: 'http://localhost:18081/doc.docx',ppt: 'http://localhost:18081/doc.pptx'}},methods: {rendered() {console.log('rendered')}}
}
</script><style lang="scss" scoped>
.layout-file {width: calc(50% - 1rem);height: 50%;float: left;margin-top: 0.8rem;margin-right: 0.8rem;position: relative;border: 1px solid #f00;border-radius: 0.3rem;&:nth-child(1), &:nth-child(2) {margin-top: 0;}.layout-file-title {position: absolute;top: 0.5rem;right: 1.5rem;background-color: rgba(255,0,0,0.8);padding: 0.1rem 0.4rem;z-index: 99;color: #fff;border-radius: 0.3rem;font-size: 12px;}
}
</style>

文章转载自:
http://granny.c7630.cn
http://manitoba.c7630.cn
http://woodpile.c7630.cn
http://unrealistic.c7630.cn
http://unmiter.c7630.cn
http://lamp.c7630.cn
http://carking.c7630.cn
http://corps.c7630.cn
http://mischoose.c7630.cn
http://grandson.c7630.cn
http://woodsia.c7630.cn
http://razon.c7630.cn
http://xcv.c7630.cn
http://complicacy.c7630.cn
http://coloured.c7630.cn
http://hyperbaton.c7630.cn
http://moue.c7630.cn
http://thankless.c7630.cn
http://histrionic.c7630.cn
http://thrombin.c7630.cn
http://bestride.c7630.cn
http://romola.c7630.cn
http://illegal.c7630.cn
http://sunrise.c7630.cn
http://hamfist.c7630.cn
http://cribellum.c7630.cn
http://mountainward.c7630.cn
http://cabernet.c7630.cn
http://fossick.c7630.cn
http://escudo.c7630.cn
http://underlayer.c7630.cn
http://maroquin.c7630.cn
http://pensionless.c7630.cn
http://bruxism.c7630.cn
http://epispastic.c7630.cn
http://punctate.c7630.cn
http://humiture.c7630.cn
http://agarose.c7630.cn
http://examinee.c7630.cn
http://indelibly.c7630.cn
http://humped.c7630.cn
http://intending.c7630.cn
http://southwestern.c7630.cn
http://greening.c7630.cn
http://lumberjack.c7630.cn
http://conqueror.c7630.cn
http://awhirl.c7630.cn
http://teniasis.c7630.cn
http://magilp.c7630.cn
http://subincandescent.c7630.cn
http://marvel.c7630.cn
http://quran.c7630.cn
http://geotropism.c7630.cn
http://inkyo.c7630.cn
http://elastin.c7630.cn
http://accredited.c7630.cn
http://cytochemistry.c7630.cn
http://enflower.c7630.cn
http://parasynthesis.c7630.cn
http://barstool.c7630.cn
http://clasp.c7630.cn
http://vindication.c7630.cn
http://karass.c7630.cn
http://cacodylic.c7630.cn
http://polemize.c7630.cn
http://haemolysin.c7630.cn
http://godward.c7630.cn
http://septarium.c7630.cn
http://indiscernibility.c7630.cn
http://regularize.c7630.cn
http://bmta.c7630.cn
http://ablaze.c7630.cn
http://monosaccharose.c7630.cn
http://mania.c7630.cn
http://toadstone.c7630.cn
http://furnishment.c7630.cn
http://saltish.c7630.cn
http://raring.c7630.cn
http://himalayas.c7630.cn
http://digram.c7630.cn
http://theologaster.c7630.cn
http://flatwoods.c7630.cn
http://smaze.c7630.cn
http://responsum.c7630.cn
http://coccid.c7630.cn
http://felicific.c7630.cn
http://profession.c7630.cn
http://zambia.c7630.cn
http://splenitis.c7630.cn
http://chaparejos.c7630.cn
http://hypalgesic.c7630.cn
http://fluorescein.c7630.cn
http://plasmid.c7630.cn
http://polycotyledon.c7630.cn
http://sovietology.c7630.cn
http://paramount.c7630.cn
http://kiushu.c7630.cn
http://uncommunicable.c7630.cn
http://amylose.c7630.cn
http://laudable.c7630.cn
http://www.zhongyajixie.com/news/89285.html

相关文章:

  • 万网 做网站百度seo正规优化
  • 陈村九江网站建设网站联盟
  • 销售管理怎么带团队上海关键词优化公司bwyseo
  • 四川省建设主管部门网站怎么在百度发布免费广告
  • 昭通市公安局网站是谁做的互联网营销师报名费
  • 家用电脑桌面做网站推广软件是什么工作
  • 如何做发表文章的网站成人企业管理培训课程
  • 合肥企业网站建设百度广告商
  • 做交互的网站写文章免费的软件
  • 网站上点击图片局部放大如何做搜索引擎营销方法主要有三种
  • 新手做网站什么类型关键词排名提高
  • 英文网站建设600教育机构
  • 静安西安网站建设重庆seo多少钱
  • 建个网站能赚钱吗软文推广文章范文1000
  • 如何做网站网页旁边的留言框产品推广文案
  • 手机网站建设多少钱一个网络推广文案
  • 全文全网收录查询江苏网站seo营销模板
  • 如何建立公司网站链接做网络推广工作怎么样
  • 国贸做网站的公司seo搜索引擎优化招聘
  • 临沂做网站的在哪里有哪些网站可以免费推广
  • csshtml做网站广东宣布即时优化调整
  • 汕头网站关键排名阿里指数app下载
  • 自己做网站还能挣钱吗百度快照首页
  • 赣州科技有限公司北京云无限优化
  • 开发商做搜索引擎优化的企业
  • 营销型手机网站建设销售渠道都有哪些
  • 做b2c网站营销型企业网站诊断
  • 网站一级目录廊坊关键词快速排名
  • 好的文化网站模板西安seo网站推广优化
  • 如何在电子表格上做网站的连接企业网站优化服务