vue-pdf
vue-pdf copied to clipboard
TypeError: linkService is undefined
Hi,
The viewer is working well.
But I have an error in the console each time vue-pdf is created :
TypeError: linkService is undefined
Source :
<template>
<div class="filePreview">
<audio v-if="file.format == 'Audio'" :src="fileUrl" preload="metadata" controls></audio>
<img v-else-if="file.format == 'Image'" :src="fileUrl" :alt="file.name">
<pdf v-else-if="file.format == 'Pdf'" :src="fileUrl" @error="log"></pdf>
<video v-else-if="file.format == 'Video'" :src="fileUrl" preload="metadata" controls></video>
</div>
</template>
<script>
import Pdf from 'vue-pdf'
export default {
components: {
Pdf
},
computed: {
fileUrl() {
return this.$store.state.baseUrl + '/' + this.file.path;
}
},
methods: {
log(value) {
console.log(value);
}
},
props: {
file: {
type: Object,
required: true
}
},
data: function() {
return {
};
}
}
</script>
<style>
.filePreview {
padding: 2px;
border: 2px solid black;
border-radius: 4.2px;
}
</style>
Thanks
@VS64 Try using this forked project instead: https://www.npmjs.com/package/@teckel/vue-pdf