diff options
author | Zero~Informatique | 2020-06-19 22:12:03 +0200 |
---|---|---|
committer | Zero~Informatique | 2020-06-19 22:12:03 +0200 |
commit | 69dc0d20706ed41e5ecdbb77515066d8a7d7703b (patch) | |
tree | 8b69fcb1d4a96290134980e75281563f8b4c271e /viewer/src/components/LdPdfViewer.vue | |
parent | a053076d692be5e3698fe1a2c071d077cb4b6b73 (diff) | |
download | ldgallery-69dc0d20706ed41e5ecdbb77515066d8a7d7703b.tar.gz |
viewer: code update (no functional change)
Types { [x: T]: R } updated to Record<T, R>
Methods in template updated to getters (computed in VueJS), which are reactive and cached
Code formatting
Diffstat (limited to 'viewer/src/components/LdPdfViewer.vue')
-rw-r--r-- | viewer/src/components/LdPdfViewer.vue | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/viewer/src/components/LdPdfViewer.vue b/viewer/src/components/LdPdfViewer.vue index 20055cc..b1f6c64 100644 --- a/viewer/src/components/LdPdfViewer.vue +++ b/viewer/src/components/LdPdfViewer.vue | |||
@@ -22,7 +22,7 @@ | |||
22 | <!-- intermediate container necessary to eliminate the double scrollbar --> | 22 | <!-- intermediate container necessary to eliminate the double scrollbar --> |
23 | <div class="fill no-scroll"> | 23 | <div class="fill no-scroll"> |
24 | <!-- prefer native browser PDF viewer if available --> | 24 | <!-- prefer native browser PDF viewer if available --> |
25 | <object class="fill" :data="itemResourceUrl()" type="application/pdf"> | 25 | <object class="fill" :data="itemResourceUrl" type="application/pdf"> |
26 | <!-- TODO: fallback to PDF.js (https://github.com/pacien/ldgallery/issues/212) --> | 26 | <!-- TODO: fallback to PDF.js (https://github.com/pacien/ldgallery/issues/212) --> |
27 | <ld-download :item="pdfItem" /> | 27 | <ld-download :item="pdfItem" /> |
28 | </object> | 28 | </object> |
@@ -32,15 +32,15 @@ | |||
32 | <script lang="ts"> | 32 | <script lang="ts"> |
33 | import { Component, Prop, Vue } from "vue-property-decorator"; | 33 | import { Component, Prop, Vue } from "vue-property-decorator"; |
34 | 34 | ||
35 | @Component export default class LdPdfViewer extends Vue { | 35 | @Component |
36 | export default class LdPdfViewer extends Vue { | ||
36 | @Prop({ required: true }) readonly pdfItem!: Gallery.PDF; | 37 | @Prop({ required: true }) readonly pdfItem!: Gallery.PDF; |
37 | 38 | ||
38 | itemResourceUrl(): string { | 39 | get itemResourceUrl(): string { |
39 | return this.$galleryStore.resourceRoot + this.pdfItem.properties.resource; | 40 | return this.$galleryStore.resourceRoot + this.pdfItem.properties.resource; |
40 | } | 41 | } |
41 | } | 42 | } |
42 | </script> | 43 | </script> |
43 | 44 | ||
44 | <style lang="scss" module> | 45 | <style lang="scss" module> |
45 | |||
46 | </style> | 46 | </style> |