Vue Bootstrap img not displaying from assets folder - image

I am trying to display an image like what is done in this tutorial https://bootstrap-vue.js.org/docs/components/image/
Here is my code
<template>
<b-container fluid class="p-4 bg-dark">
<b-row>
<b-col>
<b-img rounded="circle" thumbnail fluid src="require('../assets/sweetcart.jpg')" alt="Thumbnail" />
</b-col>
<b-col>
<b-img rounded="circle" thumbnail fluid src="https://picsum.photos/250/250/?image=58" alt="Thumbnail" />
</b-col>
<b-col>
<b-img rounded="circle" thumbnail fluid src="https://picsum.photos/250/250/?image=59" alt="Thumbnail" />
</b-col>
</b-row>
</b-container>
</template>
Here is my file structure, although im sure the file path for the image is correct as I have been able to display the image in its own div tag, issue seems to be something to do with bootstrap?
I am working within the Home.vue file.
Thanks for any help!

I managed to fix this by placing the image in the static folder instead of the assets folder.
I am still curious as to why this wouldn't work in the assets folder?
These guys are discussing something similar but there seemed to be no definitive answer.
https://github.com/vuejs/Discussion/issues/202

Related

Logo on Navbar Won't Show in Laravel Jetstream

So I learn Laravel Jetstream using Inertia Stack. While I was doing some changing on Logo in the Navbar on Dashboard view it's still showing.
But when I go to profile view, it's just gone, I don't know why, but if I try using blade function which is asset function, it'll be gone in dashboard view too.
This is my code on ApplicationMark.vue:
<template>
<img class="block h-9 w-auto" src="favicon.png" alt="Logo">
<!-- <img class="block h-9 w-auto" src="{{ asset('favicon.png') }}" alt="Logo"> -->
</template>

Laravel and Vue: How do I get images from my public folder in a Vue component?

I am trying to get a logo image from my public folder in my laravel and Vue application. The file is called index.vue and have the following structure:
<template>
<div>
<div class="header-container">
<div class="header-content">
<div class="logo-container">
<img :src="'/public/images/logo/black.png'" alt="logo">
</div>
</div>
</div>
<!-- Tell Vue where to render components -->
<router-view></router-view>
</div>
</template>
Here is the file structure and you can see that file exists and the path is correct:
But when I switch back to the view it looks like this:
I have also tried to call it the way I would in a blade template using {{ asset() }}, but this doesn't work and gives me a compiler error.
How do I get this image to load in my Vue file?
Not sure about vue + laravel. But, since its a relative path I dont think you need to bind anything.
<img src="/images/logo/black.png" alt="logo">

img src not working to showing Images Laravel 8

i am beginner of Laravel 8. i creating simple project. but when i view the project images are not shown.
View Page
Index.php
<div>
<img src="{{asset('/images/chocolate-ice.jpg')}}" id="Chocolate" class="photo" width="100" height="100" data-toggle="modal" data-target="#exampleModal">
<b>Chocolate</b>
</div>
Folder structure
If you want to use Blade your template/view must end in .blade.php. That is how the view system knows what view engine to use. When it is just .php it does not use the Blade compiler to parse the template.

vue/laravel images not showing (not found) using laravel storage folder

am trying to display my images dynamically from laravel storage folder but it says images not found even though i can see the pictures adding up in the folder, i also tried php artisan link but nothing good
<v-btn flat v-on="on">
<div>
{{connectedUser.name }} {{ connectedUser.last_name }}
<v-avatar size="38px"">
<img :src="'http://api.sirh.test/storage/'+connectedUser.img" />
</v-avatar>
</div>
</v-btn>
Try this.
:src=‘getImage(connectedUser)’
getImage(connectedUser){
return /storage/ + connectedUser.img
}

How to load images in joomla component template

I am trying to using image tag to load image to a component template.
By
<img src="\images\subfolder\image.jpg" />
but the images don't show in the page.
I am wondering why.
Thank you.
Try this,
<img src="<?php echo JURI::root()?>images/subfolder/image.jpg" />
Hope its works..

Resources