属性说明

    picker-view-column

    <picker-view /> 的子组件,仅可放置于 <picker-view /> 中,其子节点的高度会自动设置成与 picker-view 的选中框的高度一致

    1. export default {
    2. data: function () {
    3. const date = new Date()
    4. const years = []
    5. const year = date.getFullYear()
    6. const months = []
    7. const month = date.getMonth() + 1
    8. const days = []
    9. const day = date.getDate()
    10. for (let i = 1990; i <= date.getFullYear(); i++) {
    11. years.push(i)
    12. months.push(i)
    13. }
    14. for (let i = 1; i <= 31; i++) {
    15. days.push(i)
    16. }
    17. return {
    18. title: 'picker-view',
    19. years,
    20. year,
    21. months,
    22. month,
    23. days,
    24. visible: true,
    25. indicatorStyle: `height: ${Math.round(uni.getSystemInfoSync().screenWidth/(750/100))}px;`
    26. }
    27. },
    28. methods: {
    29. bindChange: function (e) {
    30. const val = e.detail.value
    31. this.year = this.years[val[0]]
    32. this.month = this.months[val[1]]
    33. this.day = this.days[val[2]]
    34. }
    35. }

    • app-nvue 暂不支持 <picker-view>

    发现错误?想参与编辑?