nhayder
5 months ago
1069
1
Vue

Vue.js is showing error during loading of image src (404 (Not Found))

Posted 5 months ago by nhayder

Hi, i'm seeing an error on 3 of my vue components

GET http://127.0.0.1:8000/image/md/ 404 (Not Found)

this is the image as i have it on the component

<div class="w-full px-3 mb-6 md:mb-0">

    <label class="uppercase mb-2">Image</label>

    <img :src="thumbnail()" class="my-3">

</div>

the thumbnail() method is being executed like this


methods: {

        thumbnail : function(){

            var url = this.smcard;

            if (url == '/media/default/placeholder.png') {

                return url;

            }else{

                console.log('URL ='+url); 

                return '/image/md/'+url;

            }

        },

}

the console.log('URL ='+url); is showing empty value which is causing the component to show 404 not found error.

But after loading the component i can see the proper image being loaded properly on the page.

any idea on how to fix this issue.

Please sign in or create an account to participate in this conversation.