javascript – Problem mit dem Mini-Programmstil
伊谢尔伦
伊谢尔伦 2017-05-19 10:47:24
0
1
573

Wenn die Daten durchgeschleift werden, treten Probleme mit dem Stil auf, wie unten gezeigt:

Code

<view class="item" wx:for="{{moreTake}}" style="background:url({{item.bgImg}}) no-repeat; background-size:100% 100%;">
      <view class="label">
        <text class="zh">{{item.zhName}}</text>
        <text class="en">{{item.enName}}</text>
      </view>
      <scroll-view class="scroll-view"  scroll-x="true" >
        <view class="type" style="width:360rpx;background:none;"></view>
        <view class="type" wx:for="{{item.content}}">
          <text>{{item.name}}</text>
          <image src="{{item.img}}" style="width:90%;height:130rpx;"></image>
          <text class="btn">+订阅</text>
        </view>
      </scroll-view>
  </view>

Wenn die Daten im normalen Stil geschrieben sind, wie unten gezeigt

Code

<view class="item" style="background:url(https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1491565891140&di=483e2b7a953fa5312f8e77148b5c3890&imgtype=0&src=http%3A%2F%2Fimg.article.pchome.net%2F00%2F22%2F80%2F24%2Fpic_lib%2Fwm%2F2366sun008.jpg) no-repeat; background-size:100% 100%;">
      <view class="label">
        <text class="zh">中文</text>
        <text class="en">English</text>
      </view>
      <scroll-view class="scroll-view"  scroll-x="true" >
        <view class="type" style="width:360rpx;background:none;"></view>
        <view class="type">
          <text>精选</text>
          <image src="../../img/i1.png" style="width:90%;height:130rpx;"></image>
          <text class="btn">+订阅</text>
        </view>
        <view class="type">
          <text>精选</text>
          <image src="../../img/i1.png" style="width:90%;height:130rpx;"></image>
          <text class="btn">+订阅</text>
        </view>
        <view class="type">
          <text>精选</text>
          <image src="../../img/i1.png" style="width:90%;height:130rpx;"></image>
          <text class="btn">+订阅</text>
        </view>
      </scroll-view>
  </view>

Was ist der Grund dafür? Vielen Dank an alle

伊谢尔伦
伊谢尔伦

小伙看你根骨奇佳,潜力无限,来学PHP伐。

Antworte allen(1)
習慣沉默

scroll-view需要设置高度 不然数据加载后不会撑开

Neueste Downloads
Mehr>
Web-Effekte
Quellcode der Website
Website-Materialien
Frontend-Vorlage