微信小程序picker-view文字过长换行

发布于:

#代码

html
<picker-view indicator-style="height: 60px;" style="width: 100%; height: 300px;" value="{{pickerValue}}" bindchange="bindIndustryChange" disabled="{{disabled}}" > <picker-view-column> <view wx:for="{{currentIndustryData.first}}" wx:key="index" class="column-item"> {{item}} </view> </picker-view-column> <picker-view-column> <view wx:for="{{currentIndustryData.second}}" wx:key="index" class="column-item"> {{item}} </view> </picker-view-column> <picker-view-column> <view wx:for="{{currentIndustryData.third}}" wx:key="index" class="column-item"> {{item}} </view> </picker-view-column> </picker-view>
scss
.column-item { line-height: 1.3; text-align: center; word-wrap: break-word; word-break: break-all; white-space: normal; display: flex; align-items: center; justify-content: center; padding: 0 8px; height: 60px; box-sizing: border-box; font-size: 14px; }

#效果