office.vue 995 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <template>
  2. <div class="wrap">
  3. <web-view :src="filePath"></web-view>
  4. </div>
  5. </template>
  6. <script>
  7. import Base64 from 'base-64'
  8. //引入相关样式
  9. export default {
  10. data() {
  11. return {
  12. filePath: "", // 预览地址
  13. fileType: "", // 文件类型
  14. };
  15. },
  16. onLoad(options) {
  17. console.log(options)
  18. this.filePath =`http://121.28.24.104:13898/app/kkfile/onlinePreview?url=${encodeURIComponent(Base64.encode(options.url))}`
  19. // this.fileType = options.type
  20. // encodeURIComponent(Base64.encode(options.url))
  21. },
  22. methods: {
  23. },
  24. };
  25. </script>
  26. <style scoped lang="scss">
  27. .wrap {
  28. width: 100vw;
  29. height: 100vh;
  30. padding: 40px 0 0 0;
  31. .content {
  32. white-space: pre;
  33. width: 100%;
  34. height: 100%;
  35. padding: 20px 10px;
  36. background: #fff;
  37. overflow-x: auto;
  38. }
  39. .van-loading {
  40. background-color: #fff;
  41. position: absolute;
  42. width: 100vw;
  43. height: 100vh;
  44. display: flex;
  45. align-items: center;
  46. justify-content: center;
  47. }
  48. }
  49. </style>