nuxt-modules / og-image

Generate OG Images with Vue templates in Nuxt.
https://nuxtseo.com/og-image
400 stars 25 forks source link

unocss/tailwindcss cannot be used normally in the component #94

Closed lxccc812 closed 9 months ago

lxccc812 commented 11 months ago

Describe the bug

When I used the background graph property in the template component, it didn't display properly

<template>
    <div
        class="h-full w-full bg-[url(@/assets/img/og-image.png)]"
    >
    </div>
</template>

日志信息:

[Vue Router warn]: No match found for location with path "/api/@/assets/img/og-image.png"
[Vue Router warn]: No match found for location with path "/api/@/assets/img/og-image.png"
[Vue Router warn]: No match found for location with path "/api/@/assets/img/og-image.png"
[Vue Router warn]: No match found for location with path "/api/@/assets/img/og-image.png"

Redundant /api paths appear in the path during parsing, causing the file to not be located correctly

Reproduction

none

System / Nuxt Info

nuxt: 3.7.4
nuxt-og-image: 2.1.1
harlan-zw commented 9 months ago

Hi, thanks for the issue.

Unfortunately, any URLs that require bundling are not likely to work. You should instead relative image links from the public directory or use absolute image URLs.

You can read more here: https://nuxtseo.com/og-image/guides/icons-and-images