wszgrcy / angular-miniprogram

使用Angular开发小程序
https://wszgrcy.github.io/angular-miniprogram/
MIT License
202 stars 19 forks source link

图片加载问题 #33

Open lanxuexing opened 2 years ago

lanxuexing commented 2 years ago
你好,{{user}},这是使用angular开发小程序的一个模板项目
<lib-first></lib-first>
<img class="img" src="https://images.unsplash.com/photo-1441742917377-57f78ee0e582?h=1024" />
.img {
  width: 375px;
  height: 375px;
}

无法加载出图片,源码是直接编译成了img标签

<block wx:if="{{hasLoad}}">{{nodeList[0].value}}<lib-first nodePath="{{nodePath}}" nodeIndex="1" class="{{nodeList[1].class}}" style="{{nodeList[1].style}}" ></lib-first><img  src="https://images.unsplash.com/photo-1441742917377-57f78ee0e582?h=1024" class="{{nodeList[2].class}}" style="{{nodeList[2].style}}" /></block>
wszgrcy commented 2 years ago

不好意思,刚看到.img应该是浏览器标签.如果要使用小程序可以使用 image https://developers.weixin.qq.com/miniprogram/dev/component/image.html 不过这种兼容未来可能会单独增加接口,抽象出来供转换实现,目前的话应该不会把img变为image