Ionic image loading tips
P粉416996828
P粉416996828 2023-08-26 20:03:50
0
1
486

I'm just playing around with Ionic and Vue 3.

But when I use the ion-img tag, the images loaded from the assets folder are not displayed correctly.

Folder structure:

- assets -- logo.svg - views -- Authentication.vue

When I load the image using standard HTML img it works fine, but not when using ion-img.

   

I have tried the following different src paths:

./assets/logo.svg ../assets/logo.svg ../../assets/logo.svg (unreasonable, but I tried it too) ~/assets/logo.svg

Any suggestions on this?

P粉416996828
P粉416996828

reply all (1)
P粉281089485

Check out this answer:

How to reference static resources in vue javascript

In short, you can get the results you want by:

    Latest Downloads
    More>
    Web Effects
    Website Source Code
    Website Materials
    Front End Template
    About us Disclaimer Sitemap
    php.cn:Public welfare online PHP training,Help PHP learners grow quickly!