index.vue 590 B

1234567891011121314151617181920212223242526272829303132
  1. <template>
  2. <view class="box">
  3. <ss-preview :fileUrl="fileUrl" :fileType="fileType"></ss-preview>
  4. </view>
  5. </template>
  6. <script>
  7. export default {
  8. components:{},
  9. data() {
  10. return {
  11. fileUrl: '',
  12. fileType: '2',
  13. fileMap: {
  14. '1': '/static/pdf/2.pdf',
  15. '2': '/static/pdf/3.pdf',
  16. '3': '/static/pdf/1.pdf'
  17. }
  18. };
  19. },
  20. onLoad(options) {
  21. console.log(options)
  22. const fileIndex = options.file || '1';
  23. this.fileUrl = this.fileMap[fileIndex] || this.fileMap['1'];
  24. }
  25. };
  26. </script>
  27. <style lang="scss" scoped>
  28. .box {
  29. padding: 0;
  30. }
  31. </style>