vue-pdf icon indicating copy to clipboard operation
vue-pdf copied to clipboard

TypeError: linkService is undefined

Open VS64 opened this issue 7 years ago • 1 comments

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 avatar Feb 20 '18 10:02 VS64

@VS64 Try using this forked project instead: https://www.npmjs.com/package/@teckel/vue-pdf

teckel12 avatar Apr 09 '23 21:04 teckel12