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 }) },

      

  • 相关阅读:
    Feature fake , new view in comment.
    MeeGo Architect
    小米手机 怪诞行为经济学
    [转载]ten years as a programmer
    C++ 头文件
    关于AGILE/TDD 和传统的design
    你是否在开发正确的产品
    正确的创业
    MeeGo架构
    Unit Test
  • 原文地址:https://www.cnblogs.com/huichao1314/p/12485098.html
Copyright © 2011-2022 走看看