2***@qq.com
2***@qq.com
  • 发布:2021-01-05 16:49
  • 更新:2021-01-06 11:14
  • 阅读:575

【报Bug】使用pick-view写的date选择器滚动选择日期选不到最后一行

分类:uni-app

产品分类: uniapp/小程序/阿里

PC开发环境操作系统: Windows

PC开发环境操作系统版本号: win10

HBuilderX类型: 正式

HBuilderX版本号: 2.9.3

第三方开发者工具版本号: 1.5.12

基础库版本号: 1.7.95

项目创建方式: HBuilderX

示例代码:

<template>
<view>
<page-head :title="title"></page-head>
<view class="uni-padding-wrap">
<view class="uni-title">
日期:{{year}}年{{month}}月{{day}}日
</view>
</view>
<picker-view v-if="visible" indicator-style="height: 40px;border:1px solid red;" class="mpvue-picker-view " :value="value" @change="bindChange">
<picker-view-column>
<view class="item" v-for="(item,index) in years" :key="index">{{item}}年</view>
</picker-view-column>
<picker-view-column>
<view class="item" v-for="(item,index) in months" :key="index">{{item}}月</view>
</picker-view-column>
<picker-view-column>
<view class="item" v-for="(item,index) in days" :key="index">{{item}}日</view>
</picker-view-column>
</picker-view>
</view>
</template>

<script>
export default {
data () {
const date = new Date()
const years = []
const year = date.getFullYear()
const months = []
const month = date.getMonth() + 1
const days = []
const day = date.getDate()

        for (let i = 1990; i <= date.getFullYear(); i++) {  
            years.push(i)  
        }  

        for (let i = 1; i <= 12; i++) {  
            months.push(i)  
        }  

        for (let i = 1; i <= 31; i++) {  
            days.push(i)  
        }  
        return {  
            title: 'picker-view',  
            years,  
            year,  
            months,  
            month,  
            days,  
            day,  
            value: [9999, month - 1, day - 1],  
            /**  
             * 解决动态设置indicator-style不生效的问题  
             */  
            visible: true,  
            indicatorStyle: `height: 40px;border:1px solid red;`  
        }  
    },  
    methods: {  
        bindChange (e) {  
            const val = e.detail.value  
            this.year = this.years[val[0]]  
            this.month = this.months[val[1]]  
            this.day = this.days[val[2]]  
        }  
    }  
}  

</script>

<style>

picker-view {  
    width: 100%;  
    position: relative;  
    bottom: 0;  
    left: 0;  
    width: 100%;  
    height: 238px;  
    background-color: blue;  
}  

.item {  
    height:40px;  
    line-height:40px;  
    text-align: center;  
}  

</style>

操作步骤:

向上滑动picker的每一列,滑至底部,滑不到最后一个

预期结果:

向上滑动,可以滑到最后一个,并可以选中值

实际结果:

向上滑动,滑不到最后一个,选不到最后一个值

bug描述:

2021-01-05 16:49 负责人:无 分享
已邀请:
DCloud_UNI_Anne

DCloud_UNI_Anne

问题已验证,后续修复,已加分,感谢您的反馈!

该问题目前已经被锁定, 无法添加新回复