当前位置:网站首页>Uniapp preview function
Uniapp preview function
2022-06-13 02:02:00 【Little four is a Virgo】
Project file structure 
hybrid The file is the core download by Baidu itself
previewPdf.vue
<template>
<view style="width: 100%;" >
<view style="height: 100rpx;">
<uni-nav-bar left-icon="left" title=" File preview " @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', // A format file stream js file The end of the article will be shared
}
},
onLoad(options) {
let fileUrl = encodeURIComponent(options.links) // encodeURIComponent Function can take a string as URI Components are encoded .
this.allUrl = this.viewerUrl + '?file=' + fileUrl
console.log("pdf",options)
}
}
</script>
<style>
</style>
Preview effect 
边栏推荐
- 水管工游戏
- General IP address, account and password of mobile IPv6 optical cat login, and mobile optical cat is in bridging mode
- STM32 steering gear controller
- 华为设备配置双反射器优化虚拟专用网骨干层
- 一、搭建django自动化平台(实现一键执行sql)
- rsync 传输排除目录
- Interruption of 51 single chip microcomputer learning notes (external interruption, timer interruption, interrupt nesting)
- Cmake has no obvious error after compilation, but prompts that pthread cannot be found
- What did Hello travel do right for 500million users in five years?
- STM32 timer interrupt learning notes
猜你喜欢

General IP address, account and password of mobile IPv6 optical cat login, and mobile optical cat is in bridging mode

Devaxpress Chinese description --tdximageslider (picture rotation control)

Detailed understanding of white noise

Learning notes 51 single chip microcomputer keyboard (non coding keyboard and coding keyboard, scanning mode of non coding keyboard, independent keyboard, matrix keyboard)

3、 Upload fabric photos to SQL server and provide name to display fabric photos

QT realizes mind mapping function (II)
![[work with notes] NDK compiles the open source library ffmpeg](/img/24/ed33e12a07e001fc708e0c023e479c.jpg)
[work with notes] NDK compiles the open source library ffmpeg

What is the path field—— Competitive advertising

STM32 sensorless brushless motor drive

Server installation jupyterab and remote login configuration
随机推荐
Delphi7 compressed pictures (BMP, JPG, PNG)
传感器:MQ-5燃气模块测量燃气值(底部附代码)
JSON and protobuf Any interchange
Devaxpress Chinese description --tdximageslider (picture rotation control)
What is solid angle
Detailed understanding of white noise
[learning notes] xr872 audio driver framework analysis
[the fourth day of actual combat of stm32f401ret6 smart lock project in 10 days] voice control is realized by externally interrupted keys
rsync 傳輸排除目錄
Delphi implements adding a column of serial number to the CXGRID list
[programming idea] communication interface of data transmission and decoupling design of communication protocol
The method of drawing rounded panel with Delphi
16 embedded C language interview questions (Classic)
Combining strings and numbers using ssstream
How to learn C language and share super detailed experience (learning note 1 -- basic data types of C language)
如何解决通过new Date()获取时间写出数据库与当前时间相差8小时问题【亲测有效】
[sequence structure, branch structure, loop structure, continue statement, break statement, return statement] (learning Note 6 -- C language process control)
QT realizes mind mapping function (II)
DFS and BFS to solve Treasure Island exploration
Rsync transport exclusion directory