源码网商城,靠谱的源码在线交易网站 我的订单 购物车 帮助

源码网商城

微信小程序 仿美团分类菜单 swiper分类菜单

  • 时间:2021-02-04 16:10 编辑: 来源: 阅读:
  • 扫一扫,手机访问
摘要:微信小程序 仿美团分类菜单 swiper分类菜单
有同学要仿美团分类菜单.写了一个. 跟 [url=http://www.1sucai.cn/article/98272.htm]微信小程序开发之实现选项卡(窗口顶部TabBar)页面切换[/url]很类似 [img]http://files.jb51.net/file_images/article/201704/201704120917423.gif[/img] 代码: [b]js就这么一点[/b]
//index.js 
//获取应用实例 
var app = getApp()
Page({
 data: {
  currentTab: 0,
  grids: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9],
  swiperList:[0, 1, 2, 3, 4]
 },
 onLoad: function () {
 },
 click: function (e) {
  console.log(e.currentTarget.dataset.id)
  console.log(e.currentTarget.dataset.index)
  wx.showToast({
   title: '第' + e.currentTarget.dataset.id + '栏' + '第' + e.currentTarget.dataset.index + '个',
   icon: 'success',
   duration: 1500
  })
 },
 /** 
   * 滑动切换tab 
   */
 bindChange: function (e) {
  console.log(e.detail.current)
  this.setData({ currentTab: e.detail.current });
 },
})
以上就是本文的全部内容,希望本文的内容对大家的学习或者工作能带来一定的帮助,同时也希望多多支持编程素材网!
  • 全部评论(0)
联系客服
客服电话:
400-000-3129
微信版

扫一扫进微信版
返回顶部