Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How does vue preview pdf, word, xls, ppt, txt files

2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly explains "how to preview pdf, word, xls, ppt, txt files by vue". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn how vue previews pdf, word, xls, ppt and txt files.

Tell me about method 1. Add an iframe to the page

The src address is the address of the file to be displayed

I use elementui here. If you use other ones, you can also use iframe.

2. Files such as word, xls, ppt

To use Microsoft's official preview address

Note: 1. The file address must be on the public network; 2. Static resources do not have access

In the end, all you control is the src address

Microsoft parsing address: https://view.officeapps.live.com/op/view.aspx?src= your file address

Here I just control the imgVisbleURL variable, and then the src of iframe takes the address of this variable.

3. Final effect

(1) txt

(2) word, xls, ppt

(3) pdf

At this point, I believe you have a deeper understanding of "how vue previews pdf, word, xls, ppt, txt files". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report