1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- <template>
- <div class="wrap">
- <web-view :src="filePath"></web-view>
- </div>
- </template>
- <script>
- import Base64 from 'base-64'
- //引入相关样式
- export default {
- data() {
- return {
- filePath: "", // 预览地址
- fileType: "", // 文件类型
- };
- },
- onLoad(options) {
- console.log(options)
- this.filePath =`http://121.28.24.104:13898/app/kkfile/onlinePreview?url=${encodeURIComponent(Base64.encode(options.url))}`
- // this.fileType = options.type
- // encodeURIComponent(Base64.encode(options.url))
- },
- methods: {
-
- },
- };
- </script>
- <style scoped lang="scss">
- .wrap {
- width: 100vw;
- height: 100vh;
- padding: 40px 0 0 0;
- .content {
- white-space: pre;
- width: 100%;
- height: 100%;
- padding: 20px 10px;
- background: #fff;
- overflow-x: auto;
- }
- .van-loading {
- background-color: #fff;
- position: absolute;
- width: 100vw;
- height: 100vh;
- display: flex;
- align-items: center;
- justify-content: center;
- }
- }
- </style>
|