Open leandrogabrielcunha opened 1 year ago
?
Se alguém conseguiu resolver este bug e conseguir me dar um help serei muito grato.
Hello Dear, I have Fixed this issue.
const pdfViewer = ref('');
watch(() => pdfViewer.value, () => { pdfViewer.value.zoom = 175; }, { deep: true });
Here, i'm using the watch function to watch changes to the pdfViewer ref's value. Whenever the value changes, the second function is triggered. In this case, it sets the zoom property of the pdfViewer component to 175.
The deep: true option means that it's a deep watcher, which will trigger the callback even if the properties within the pdfViewer object change.
@khalidzaibi your fix did not work, it locks it at 175. Here is a fix that works for first load and subsequent changes:
<pdf-viewer
ref="pdfViewer"
</pdf-viewer>
async mounted() {
//wait for DOM to finish rendering
await this.$nextTick();
//workaround to fix default zoom setting not working
const pdfViewer = this.$refs.pdfViewer;
this.$watch(() => pdfViewer.zoom, () => {
const zoom = pdfViewer.zoom;
pdfViewer.zoom = zoom;
}, { deep: true });
//now change the setting
pdfViewer.zoom = 175;
},
:settings="{ defaultZoom: 200 }" não funciona