Inserting images in v4.2.2


#1

Am trying out the F7 CLI in v4.2.2 and everything looks good so far. Just one issue. I can’t seem to insert an image into the page.

Something as simple as this is not working

<div class="page-content">
  <div>
   <img src="images/family.jpg">
  </div>
</div>

Am I missing something?


#2

What was your CLI parameters? What is files and folders structure?


#3

And for the folders, besides the standard folders, this is my src folder


#4

If it is in your index.html file then move it to static/ folder and refer as src="./static/family.jpg"


#5

It’s working now. Thanks.

Will this apply to other things like json files as well?


#6

Not necessary. You need to learn how to handle static assets in webpack https://webpack.js.org/guides/asset-management/#loading-images


#7

Oh, ok. Thanks. Let me get check it out.