pdf.vue 629 B

12345678910111213141516171819202122232425262728293031
  1. <template>
  2. <view class="pdf-view"> <view id="demo"></view> </view>
  3. </template>
  4. <script>
  5. export default {
  6. data() {
  7. return {
  8. pdfh5: null,
  9. pdfurl: '',
  10. title: ''
  11. }
  12. },
  13. onLoad(option) {
  14. console.log(option)
  15. this.pdfurl = 'http://localhost:8009/document/pdfdetails.html?type=1src=' + option.url
  16. this.title = option.title || ''
  17. uni.setNavigationBarTitle({
  18. title: this.title
  19. })
  20. }
  21. }
  22. </script>
  23. <style lang="scss" scoped>
  24. @import "pdfh5/css/pdfh5.css";
  25. .pdf-view {
  26. width: 100%;
  27. height: 100vh;
  28. }
  29. </style>