Closed lzinga closed 2 months ago
I have images loading and things like <img :src="doc.thumbnail" /> work great. However with certain css I am trying to set the background to an image like
<img :src="doc.thumbnail" />
:class="'w-full object-cover h-96 sm:h-[480px] bg-[url(\'' + doc.thumbnail + '\')] bg-no-repeat bg-center bg-cover rounded-xl'">
The image ends up being blank even though the image exists.
Here is the full div when viewing source.
<div class="w-full object-cover h-96 sm:h-[480px] bg-[url('/images/business.jpg')] bg-no-repeat bg-center bg-cover rounded-xl"></div>
and here is the div from inside the code
<div :class="'w-full object-cover h-96 sm:h-[480px] bg-[url(\'' + doc.thumbnail + '\')] bg-no-repeat bg-center bg-cover rounded-xl'"> </div>
Looks to be an issue with tailwind? When I set it using style attribute it works.
Background
I have images loading and things like
<img :src="doc.thumbnail" />
work great. However with certain css I am trying to set the background to an image likeIssue
The image ends up being blank even though the image exists.
Here is the full div when viewing source.
and here is the div from inside the code