_castro
_castro
NNuxt
Created by _castro on 5/10/2024 in #❓・help
NuxtImg Image Shrinking
Hey y'all, I'm having some trouble with NuxtImg, and I'm using it to display the Google Play and App Store badges, like this:
<NuxtImg src="google-play.png" />
<NuxtImg src="app-store.png" />
<NuxtImg src="google-play.png" />
<NuxtImg src="app-store.png" />
The problem is, the images are shrinking down to a smaller size. Is there a way to keep them at their original size without writing a whole CSS rule? Maybe a special prop in NuxtImg itself? I've checked the docs, and it's just telling me to:
manually set the width and height properties in the <NuxtImg> component to match the actual size of the images.
There must surely be a better way. Any help is dope, thanks!
5 replies
NNuxt
Created by _castro on 4/30/2024 in #❓・help
NuxtImg not displaying image
Hello, I'm trying to display my image via NuxtImg but it isn't able to locate the path to it. It's currently sitting at assets/logo.png, and when I try to remove the ~assets/ or ~ it still doesn't work. In DevConsole, the error message I get is: GET http://localhost:3000/_ipx/_/assets/logo.png 404 (IPX_FILE_NOT_FOUND) This is my NavBar.vue:
<template>
<div class="max-w-section mx-auto pt-6 pb-6">
<NuxtImg src="/assets/logo.png" />
Hello
</div>
</template>
<template>
<div class="max-w-section mx-auto pt-6 pb-6">
<NuxtImg src="/assets/logo.png" />
Hello
</div>
</template>
2 replies