废话不说。直接上解决方法。
uni-picker-view {
display: block;
}
uni-picker-view .uni-picker-view-wrapper {
display: flex;
position: relative;
overflow: hidden;
height: 100%;
background-color: white;
}
uni-picker-view[hidden] {
display: none;
}
picker-view {
width: 100%;
height: 300upx;
margin-top:20upx;
}
##picker-view-column,可能还需要添加下面的样式
.item {
line-height: 100upx;
text-align: center;
}
view代码
<picker-view :value="value" class="picker-content" @pickstart="bindpickstartFun" @change="bindChangeFun" @pickend="bindpickendFun" :indicator-style="indicatorStyle" :mask-style="maskStyle">
<picker-view-column>
<view v-for="(item, index) in columnsData" :key="index">
<view v-for="(itemIn, index2) in item" :key="index2" class="picker-line">
<block v-if="tempValue == index">
<text class="line1" :style="chooseTextStyle">{{isUseKeywordOfShow?itemIn[keyWordsOfShow]:itemIn}}</text>
</block>
<block v-else>
<text class="line1" :style="chooseItemTextStyle">{{isUseKeywordOfShow?itemIn[keyWordsOfShow]:itemIn}}</text>
</block>
</view>
</view>
</picker-view-column>
</picker-view>