| | |
| | | <div v-if="isDoc"> |
| | | <p v-if="!isDocShow">文档无法直接预览,请下载查看。</p> |
| | | <a :href="fileUrl" v-if="!isDocShow">下载文件</a> |
| | | <vue-office-docx |
| | | <vue-office-docx v-else |
| | | :src="fileUrl" |
| | | style="height: 100vh;" |
| | | @rendered="renderedHandler" |
| | |
| | | <div v-if="isXls"> |
| | | <p v-if="!isDocShow">文档无法直接预览,请下载查看。</p> |
| | | <a :href="fileUrl" v-if="!isDocShow">下载文件</a> |
| | | <vue-office-excel |
| | | <vue-office-excel v-else |
| | | :src="fileUrl" |
| | | :options="options" |
| | | style="height: 100vh;" |
| | |
| | | return /\.(doc|docx)$/i.test(this.fileUrl); |
| | | }, |
| | | isXls(){ |
| | | return /\.(xls|xlsx)$/i.test(this.fileUrl); |
| | | let state = /\.(xls|xlsx)$/i.test(this.fileUrl) |
| | | if(state){ |
| | | if(/\.(xlsx)$/i.test(this.fileUrl)){ |
| | | this.options.xls = false |
| | | }else{ |
| | | this.options.xls = true |
| | | } |
| | | } |
| | | return state; |
| | | }, |
| | | isZipOrRar() { |
| | | return /\.(zip|rar)$/i.test(this.fileUrl); |