双重for循环中内部循环text前后都多出一行,为啥啊?我裂开了
[图片] 如图,这个是在调试工具里的代码,迷一样的前后多出一行,导致这一行被挤下去,样式难搞。 代码真的简单到裂开 wxml: <scroll-view class="scroll" scroll-y>
<view wx:for="{{list1}}" wx:key="k">
<text class="a">{{item.k}}</text>
<text class="b">
<text wx:for="{{item.l2}}" wx:for-item="list2">
{{list2.a}}
</text>
</text>
</view>
</scroll-view>
js: /**
* 页面的初始数据
*/
data: {
list1: [
{l2: [{a:'asdf', b:'asdfasdf'},{a:'asdf', b:'asdfasdf'},{a:'asdf', b:'asdfasdf'}], k: 1},
{l2: [{a:'asdf', b:'asdfasdf'}], k: 2},
{l2: [{a:'asdf', b:'asdfasdf'}], k: 3},
{l2: [{a:'asdf', b:'asdfasdf'}], k: 4},
{l2: [{a:'asdf', b:'asdfasdf'}], k: 5},
{l2: [{a:'asdf', b:'asdfasdf'}], k: 7},
{l2: [{a:'asdf', b:'asdfasdf'}], k: 8},
{l2: [{a:'asdf', b:'asdfasdf'}], k: 9}
]
},
css: .scroll{
height: 300px;
}
.b{
display: block;
width: 300px;
height: 50px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
运行结果截图: [图片] 就迷一样的内部循环前面多了一行空行,真的绝了,求助!怎么去掉这个前后的空行?感激不尽!版本库是2.18.0