uniapp的image引用本地图片不显示问题解决

使用img标签要用绝对路径前面没有 '/'



           
 {
          type: "swiperList",
          data: [
            { imgUrl: 'static/image/img/swiper4.jpg' },
            { imgUrl: 'static/image/img/swiper5.jpg' },
            { imgUrl: 'static/image/img/swiper6.jpg' },
          ]
      }

而使用image标签时要使用相对路径或 绝对路径(前面有'/')

{
      bigUrl: "static/image/img/Children.jpg",
      data: [
          { imgUrl: "../../static/image/img/Children1.jpg" },
          { imgUrl: "../../static/image/img/Children2.jpg" },
          { imgUrl: "../../static/image/img/Children3.jpg" }
      ]
},

//或绝对路径
{
      bigUrl: "static/image/img/Children.jpg",
      data: [
          { imgUrl: "/static/image/img/Children1.jpg" },
          { imgUrl: "/static/image/img/Children2.jpg" },
          { imgUrl: "/static/image/img/Children3.jpg" }
      ]
}

你可能感兴趣的:(uni-app)