当前位置:网站首页>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
边栏推荐
- Seminar playback video: how to improve Jenkins' ability to become a real Devops platform
- TCP three handshakes and four waves
- 移植tslib时ts_setup: No such file or directory、ts_open: No such file or director
- Docker拉取mysql并连接
- Flink customizes the application of sink side sinkfunction
- Fiddler use
- Unity knowledge points (ugui 2)
- Top ten project management software similar to JIRA
- Unity basics 2
- 2022 团体程序设计天梯赛 模拟赛 L2-3 浪漫侧影 (25 分)
猜你喜欢

Data mining series (3)_ Data mining plug-in for Excel_ Estimation analysis

Unity knowledge points (ugui)

2022 团体程序设计天梯赛 模拟赛 L2-3 浪漫侧影 (25 分)

“如何实现集中管理、灵活高效的CI/CD”在线研讨会精彩内容分享

Code forces round # 784 (DIV. 4) solution (First AK CF (XD)

JS inheritance

Unity knowledge points (ugui 2)

Top ten project management software similar to JIRA

File upload vulnerability summary and upload labs shooting range documentary

可以接收多种数据类型参数——可变参数
随机推荐
Docker pulls MySQL and connects
Can you answer the questions that cannot be answered with a monthly salary of 10k-20k?
IDEA查看历史记录【文件历史和项目历史】
超好用的【通用Excel导入功能】
Code forces round # 784 (DIV. 4) solution (First AK CF (XD)
【VS Code】解决jupyter文件在vs code中显示异常的问题
Supersocket is Use in net5 - concept
关于idea调试模式下启动特别慢的优化
MySQL grouping query rules
C-11 problem h: treasure chest 2
IOTOS物联中台对接海康安防平台(iSecure Center)门禁系统
打卡:4.22 C语言篇 -(1)初识C语言 - (11)指针
Explication détaillée des fonctions send () et recv () du programme Socket
Unity knowledge points (common core classes)
Build websocket server in. Net5 webapi
JS inheritance
Unity games and related interview questions
“如何实现集中管理、灵活高效的CI/CD”在线研讨会精彩内容分享
When migrating tslib_ setup: No such file or directory、ts_ open: No such file or director
Top 9 task management system in 2022