1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
| <template>
| <view>
| <web-view :src="allUrl"></web-view>
| </view>
| </template>
|
| <script>
| export default {
| data() {
| return {
| allUrl:'',
| viewerUrl:'/static/pdf/web/viewer.html',
| pdfUrl:'http://192.168.0.98:808/temp/170307084137020-3.00/170307084137020.pdf'
| }
| },
| methods: {
|
| },
| onLoad(option) {
| // let fileUrl = decodeURIComponent(option.url)
| // this.allUrl = this.viewerUrl + '?file=' + fileUrl//将插件地址与接收的文件地址拼接起来
|
| const base64Data = getApp().globalData.tempPDF;
| this.pdfUrl = `data:application/pdf;base64,${base64Data}`;
|
| this.allUrl = this.viewerUrl + '?file=' + encodeURIComponent(this.pdfUrl)
|
| }
| }
| </script>
|
| <style>
|
| </style>
|
|