栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > Web开发 > JavaScript

微信小程序select下拉框实现源码

JavaScript 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

微信小程序select下拉框实现源码

这篇文章主要介绍了微信小程序select下拉框实现源码,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友可以参考下

小程序中是没有h5中的下拉 标签的 所以要实现下拉功能就必须自己动手写拉,这里为了更清楚的显示小程序层级 就把源码直接复制过来了



商品金额
¥99.00



{{tihuoWay}}



运费
免邮

实际付款
¥99.00



重庆分店
东莞南城分店
东莞总店

下面是js代码

Page({

  
  data: {
    select: false,
    tihuoWay: '门店自提'
  },

  
  onLoad: function(options) {

},
  bindShowMsg() {
    this.setData({
      select: !this.data.select
    })
  },
  mySelect(e) {
    var name = e.currentTarget.dataset.name this.setData({
      tihuoWay: name,
      select: false
    })
  },

  
  onShareAppMessage: function() {

}
})

.list - msg {
  padding: 0 20rpx;
  background - color: #fff;
  position: relative;
}

.list - msg1 {
  height: 60rpx;
  display: flex;
  align - items: center;
  justify - content: space - between;
}

.list - msg.list - msg2 {
  height: 60rpx;
  display: flex;
  align - items: center;
  justify - content: space - between;
  border: 1px solid#ccc;
  padding: 0 10rpx;
}

.select_box {
  background - color: #eee;
  padding: 0 10rpx;
  width: 93 % ;
  position: absolute;
  top: 130rpx;
  z - index: 1;
  overflow: hidden;
  animation: myfirst 0.5s;
}

@keyframes myfirst {
  from {
    height: 0rpx;
  }

  to {
    height: 210rpx;
  }
}

.select_one {
  height: 60rpx;
  line - height: 60rpx;
  border - bottom: 1px solid#ccc;
}

以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持考高分网。

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/72583.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号