当前位置:网站首页>uniapp 预览功能
uniapp 预览功能
2022-06-13 01:56:00 【小四是个处女座】
项目文件结构
hybrid 文件是核心自行百度下载
previewPdf.vue
<template>
<view style="width: 100%;" >
<view style="height: 100rpx;">
<uni-nav-bar left-icon="left" title="文件预览" @clickLeft="back" />
</view>
<view >
<web-view style="paddin-top: 120rpx;" :src="allUrl"></web-view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
src: '',
allUrl:'',
viewerUrl: '/hybrid/html/web/viewer.html', // 格式化文件流的一个js 文件 文末会分享出来
}
},
onLoad(options) {
let fileUrl = encodeURIComponent(options.links) // encodeURIComponent 函数可把字符串作为 URI 组件进行编码。
this.allUrl = this.viewerUrl + '?file=' + fileUrl
console.log("pdf",options)
}
}
</script>
<style>
</style>
预览效果
边栏推荐
- 如何通过受众群体定位解决实际问题?
- 什么是立体角
- 一、搭建django自动化平台(实现一键执行sql)
- MySQL download and installation
- 分享三个关于CMDB的小故事
- 万字讲清 synchronized 和 ReentrantLock 实现并发中的锁
- Developer contributions amd Xilinx Chinese Forum sharing - wisdom of questioning
- Why is Huawei matebook x Pro 2022 leading a "laptop" revolution
- [the second day of the actual combat of the smart lock project based on stm32f401ret6 in 10 days] light up with the key ----- input and output of GPIO
- Opencv camera calibration (1): internal and external parameters, distortion coefficient calibration and 3D point to 2D image projection
猜你喜欢

How to solve practical problems through audience positioning?

Explanation and application of prefix sum (one-dimensional, two-dimensional)

MySQL download and installation

STM32 3*3矩阵按键(寄存器版本)

Opencv camera calibration (1): internal and external parameters, distortion coefficient calibration and 3D point to 2D image projection

30: Kakfa simulates JSON data generation and transmission

About tkinter Canvas does not display pictures

Devaxpress Chinese description -- tdxgallerycontrol object (gallery component)

华为设备配置双反射器优化虚拟专用网骨干层

Jeux de plombiers
随机推荐
How many smart bids does Google have?
Delphi Google API text to speech MP3 file
JSON and protobuf Any interchange
Implementation and design of JMeter interface test database assertion for CSDN salary increase technology
LabVIEW大型项目开发提高质量的工具
Delphi 10.4.2 release instructions and installation methods of three patches
Using atexit to realize automatic destruct of singleton mode
Can't use typedef yet? C language typedef detailed usage summary, a solution to your confusion. (learning note 2 -- typedef setting alias)
What is solid angle
pringboot之restfull接口规范注解(二)
Opencv camera calibration (2): fish eye camera calibration
Vscode configuration header file -- Take opencv and its own header file as an example
[soft test] software designer knowledge points sorting (to be updated)
How do you use your own data to achieve your marketing goals?
Detailed explanation of audience characteristics
华为设备配置CE双归属
VI keyboard diagram
谷歌加大型文字广告是什么?怎么用?
[the second day of actual combat of smart lock project based on stm32f401ret6 in 10 days] (lighting with library function and register respectively)
一、搭建django自动化平台(实现一键执行sql)