博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
微信小程序 仿美团分类菜单 swiper分类菜单
阅读量:4085 次
发布时间:2019-05-25

本文共 913 字,大约阅读时间需要 3 分钟。

有同学要仿美团分类菜单.写了一个. 
跟很类似

仿美团分类菜单

代码: 
js就这么一点

//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 }); },})
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28

 
 

你可能感兴趣的文章
dva框架使用详解及Demo教程
查看>>
精简版 koa 简单实现
查看>>
react16 源码阅读学习记录
查看>>
ES 6 装饰器与 React 高阶组件
查看>>
React 老版本的context API使用对比
查看>>
从零开始学习Koa(一)
查看>>
从零开始学习Koa(二)
查看>>
200行代码实现简版react
查看>>
重拾React: React 16.0
查看>>
聊聊 koa 中间件
查看>>
发布订阅模式还不会??戳这里,50行核心代码,手把手教你学会
查看>>
六种排序算法的JavaScript实现以及总结
查看>>
JS专题之去抖函数
查看>>
ES6面试、复习干货知识点汇总(全)
查看>>
React中使用styled-components的基础使用
查看>>
Vue和React的对比
查看>>
react 的高阶组件再理解
查看>>
Redux源码解读
查看>>
深入理解 Redux 中间件
查看>>
Redux-saga
查看>>