2***@qq.com
2***@qq.com
  • 发布:2020-10-27 23:47
  • 更新:2022-03-01 15:25
  • 阅读:1262

安卓 .nvue页面使用 picker ,带没反应

分类:nvue
<picker mode="date" :value="date" :start="startDate" :end="endDate" @change="bindDateChange">  
     <view class="uni-input">{{date}}</view>  
</picker>  
//data  
data() {  
            const currentDate = this.getDate({  
               format: true  
           })  
            return {  
                title: 'picker',  
                array: ['中国', '美国', '巴西', '日本'],  
                index: 0,  
                date: currentDate,  
                time: '12:01'  
            }  
        },   
//computed  
                startDate() {  
                    return this.getDate('start');  
                },  
                endDate() {  
                    return this.getDate('end');  
                }  
//methods  
            bindPickerChange: function(e) {  
                console.log('picker发送选择改变,携带值为', e.target.value)  
                this.index = e.target.value  
            },  
            getDate(type) {  
                const date = new Date();  
                let year = date.getFullYear();  
                let month = date.getMonth() + 1;  
                let day = date.getDate();  

                if (type === 'start') {  
                    year = year - 60;  
                } else if (type === 'end') {  
                    year = year + 2;  
                }  
                month = month > 9 ? month : '0' + month;;  
                day = day > 9 ? day : '0' + day;  
                return `${year}-${month}-${day}`;  
            },

点击无反应

2020-10-27 23:47 负责人:无 分享
已邀请:
5***@qq.com

5***@qq.com

我也碰到这个问题了,求大神指点,该怎么解决

林依_Love

林依_Love

请问解决了吗? 也碰到了这个问题

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