<template>
<img src="/img/logo_monsitevabien.png" alt="logo"/>
</template>
May 11, 2022
4
Level 1
can't display png
I am working on Laravel and Inertia. I have some trouble displaying a png that I want to use as a logo.
I wrote this in ApplicationMark.vue :
<template>
<img :src="logo" alt="logo"/>
</template>
<script>
import logo from "public/img/logo_monsitevabien.png";
export default {
data() {
return {
logo: logo,
}
}
}
</script>
and then import it in AppLayout.vue :
import JetApplicationMark from '@/Jetstream/ApplicationMark.vue';
<Link :href="route('dashboard')">
<JetApplicationMark class="block h-9 w-auto" />
</Link>
and here is the error that I get in console :
Uncaught (in promise) Error: Cannot find module 'public/img/logo_monsitevabien.png'
I have tried to change location and path of the image mutliple times. always same error occurs.
does anyone has an idea ?
edit I also have tried this way :
<template>
<img src="public/img/logo_monsitevabien.png" alt="logo"/>
</template>
<script setup>
import { Link } from '@inertiajs/inertia-vue3';
export default {
}
</script>
Please or to participate in this conversation.