React img导入图片



  • react img标签中导入图片有两种方法

    1. import方法

      import imgURL from "";
      <img src={}>
      
    2. require方法

      <img src={require("")}
      

    需要注意的是,require里只能写静态的字符串,不能写变量或者是函数


 

Copyright © 2018 bbs.dian.org.cn All rights reserved.

Looks like your connection to Dian was lost, please wait while we try to reconnect.