Correct way to use image assets in Ionic 2

前端 未结 4 1582
一向
一向 2021-01-31 07:51

What’s the best practice for image assets in Ionic 2? I have a bunch of SVGs I want to use as non-system icons. I found some older tips on using Gulp but it seems Ionic team has

4条回答
  •  你的背包
    2021-01-31 08:11

    [...] it seems Ionic team has decided on Rollup as the build tool of choice, no docs on this so far.

    Seems like you're asking how to manage images with the new RC.0

    Just like you can see in the conference app the images are stored in src/assets/img and then you can add them to your html code like this:

    
    

    This is one of the steps mentioned in the Modifying your Existing Project guide (step 31 to be precise), so I guess this is what Ionic team recommends.

提交回复
热议问题