当前位置:网站首页>Applet - more than two pieces of folding and expansion logic
Applet - more than two pieces of folding and expansion logic
2022-04-23 03:27:00 【Open the door of the world】
Demand background :
There are not too many applet product data , So there's no paging , But the whole show takes up too much space . So make more than two pieces to unfold and fold , The users themselves
design sketch
Realize the idea
prospects : More than two , Show unfold collapse legend .
Click on the legend , The data transfer , And sign in .
If showAll == true , Indicate that you want to show all , Directly return the incoming data to
If showAll == false , Show only two . Loop in data , Save it , And back to
index.wxs
var goodsList = function (list = [], showAll) {
if (showAll == false) {
var showList = [];
if (list.length > 2) {
for (var i = 0; i < 2; i++) {
showList.push(list[i]);
}
} else {
showList = list;
}
return showList;
} else {
return list;
}
};
module.exports = {
goodsList: goodsList,
};
Just introduce it where needed
index.wxml
<wxs module="handlerShow" src="./index.wxs"></wxs>
<block wx:for="{
{handlerShow.goodsList(goodsList , showAll)}}" wx:key="index">
</block>
Due to the introduction , No data yet , So pass in the default parameter in the formal parameter
版权声明
本文为[Open the door of the world]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204220619450974.html
边栏推荐
- Detailed explanation of socket programming send() and recv() functions
- Top ten project management software similar to JIRA
- 月薪10k-20k都无法回答的事务问题,你会吗?
- 12.<tag-链表和常考点综合>-lt.234-回文链表
- 你真的懂hashCode和equals吗???
- L3-011 直捣黄龙 (30 分)
- Experiment 6 input / output stream
- String input problem
- Codeforces Round #784 (Div. 4)题解 (第一次AK cf (XD
- Romantic silhouette of L2-3 of 2022 group programming ladder Simulation Competition (25 points)
猜你喜欢
C interface
Unity Basics
12.<tag-链表和常考点综合>-lt.234-回文链表
Data mining series (3)_ Data mining plug-in for Excel_ Estimation analysis
Unity games and related interview questions
Web Course Design - his system
12. < tag linked list and common test site synthesis > - lt.234 palindrome linked list
2022 团体程序设计天梯赛 模拟赛 L2-1 盲盒包装流水线 (25 分)
Flink customizes the application of sink side sinkfunction
研讨会回放视频:如何提升Jenkins能力,使其成为真正的DevOps平台
随机推荐
Supersocket is Use in net5 - startup
Visual programming - drawing assignment
C set
List interface of collection
Using jsonserialize to realize data type conversion gracefully
Flink real-time data warehouse project - Design and implementation of DWS layer
数据库表中不建索引,在插入数据时,通过sql语句防止重复添加(转载)
Optimization of especially slow startup in idea debugging mode
幂等性实践操作,基于业务讲解幂等性
Problem B: small challenge
Codeforces Round #784 (Div. 4)题解 (第一次AK cf (XD
Detailed explanation of socket programming send() and recv() functions
File upload vulnerability summary and upload labs shooting range documentary
Explication détaillée des fonctions send () et recv () du programme Socket
Chapter 8 of C language programming (fifth edition of Tan Haoqiang) is good at using pointer exercises to analyze and answer
Build websocket server in. Net5 webapi
Why is bi so important to enterprises?
Visual programming - Experiment 1
超好用的【通用Excel导入功能】
How to achieve centralized management, flexible and efficient CI / CD online seminar highlights sharing