zoukankan      html  css  js  c++  java
  • 小程序下拉框选择范例

    下拉框选择范例

    <!-- 时间选择器 -->
    <picker class="weui-btn" mode="time" value="{{time}}" start="09:01" end="21:01" bindchange="bindTimeChange">
        <button type="default">时间选择器</button>
    </picker>
    <!-- 日期选择器 -->
    <picker class="weui-btn" mode="date" value="{{date}}" start="" end="" bindchange="bindTimeChange">
        <button type="default">搜索</button>
    </picker>
    <!-- 单列选择器 -->
    <picker bindchange="bindPickerChange" value="{{index}}" range="{{array}}">
          <button class="weui-btn" type="default">自定义</button>
    </picker>
    

      

     data: {
         
          time: '12:01',
          date: '2016-09-01',
          array: ['红色', '橙色', '黄色', '绿色', '青色', '蓝色', '紫色'],
          index: 0,
      },


    //时间选择器 bindTimeChange: function(e) { this.setData({ time: e.detail.value }) }, // 日期选择器 bindDateChange: function(e) { this.setData({ date: e.detail.value }) }, // 单列选择器 bindPickerChange: function(e) { console.log('picker发送选择改变,携带值为', e.detail.value);//index为数组点击确定后选择的item索引 this.setData({ index: e.detail.value }) },

      

  • 相关阅读:
    空格转换
    vuex学习
    css移动端适配方法
    数组以及数组常用方法
    21-canvas事件监听
    20-canvas之形变
    [转]session 跨域共享方案
    [转载] 从mysql,代码,服务器三个方面看mysql性能优化
    [计算机]Alan Perlis人物简介
    Python环境搭建及pip的使用
  • 原文地址:https://www.cnblogs.com/huichao1314/p/12485098.html
Copyright © 2011-2022 走看看