vue embed标签PDF预览

软件发布|下载排行|最新软件

当前位置:首页IT学院IT技术

vue embed标签PDF预览

weixin_38673922   2022-06-02 我要评论

使用embed标签PDF预览

embed的四个属性

	<el-row type="flex" class="row-bg" justify="space-between">
	  <el-col :span="12">
	    <embed
               :src='srcSourceLan'
               type="application/pdf"
               width="90%"
               height="700px;"
	    />					  	
	  </el-col>
	  <el-col :span="12">
	    <embed
               :src="srcTargetLan"
               type="application/pdf"
               width="90%"
               height="700px;"
	    />					  	
	  </el-col>
	</el-row>

srcSourceLan和srcTargetLan是请求接口返回的url 

预览效果:

使用vue-pdf预览开发正常,打包报错work.js404

解决方式

修改依赖文件node_modules下worker-loader里的index.js文件里路径

代码如下(示例):

 const filename = _loaderUtils2.default.interpolateName(this, options.name || 'static/js/[hash].worker.js', {
    context: options.context || this.rootContext || this.options.context,
    regExp: options.regExp
  });

以上为个人经验,希望能给大家一个参考,也希望大家多多支持。

Copyright 2022 版权所有 软件发布 访问手机版

声明:所有软件和文章来自软件开发商或者作者 如有异议 请与本站联系 联系我们