Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VLazyImage not resolving paths (vite & relative paths) - Only CDN Images works #102

Open
anburocky3 opened this issue Dec 25, 2021 · 2 comments

Comments

@anburocky3
Copy link

Eg:

<img src="@/assets/img/logo.png" alt="Vue Logo" class="w-8 h-8" /> <!-- Image loads fine -->

But on using it with VLazyImage

<VLazyImage src="@/assets/img/logo.png" /> <!-- Image not loads --> 

These are my vite.config.ts

export default defineConfig({
  base: "./",
  resolve: {
    alias: {
      "@": resolve(__dirname, "./src"),
    },
  },
  plugins: [vue(), Components()],
});

Even, relative links are not working here. only cdn works for now.

@alexjoverm
Copy link
Owner

alexjoverm commented Feb 13, 2022

Not sure what can be the issue here... any clues? Additionally, please check if that's the right way use use an asset on a custom component

@smakintel
Copy link

@anburocky3 I faced same issue , as mentioned by @alexjoverm " right way use use an asset on a custom component " is to use like below

<v-lazy-image :src="require('@/assets/dtins.jpg')" />

Note = :src     (colon) and wrap it inside "require"

hope this helps

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants