当前位置:网站首页>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
边栏推荐
- Chapter 9 of C language programming (fifth edition of Tan Haoqiang) analysis and answer of exercises for users to establish their own data types
- General test technology [II] test method
- Codeforces round 784 (Div. 4) (AK CF (XD) for the first time)
- Query stored procedures in PostgreSQL
- MySQL索引详解【B+Tree索引、哈希索引、全文索引、覆盖索引】
- Visual programming - Experiment 2
- Unity knowledge points (ugui)
- Fiddler use
- Experiment 6 input / output stream
- Why is bi so important to enterprises?
猜你喜欢

Unity basics 2

Test questions (2)

淺學一下I/O流和File類文件操作
![[mock data] fastmock dynamically returns the mock content according to the incoming parameters](/img/1e/c4aad49d16fb21a19865ba75128e43.png)
[mock data] fastmock dynamically returns the mock content according to the incoming parameters

. net 5 Web custom middleware implementation returns the default picture

Build websocket server in. Net5 webapi

Unity knowledge points (ugui)

Utgard connection opcserver reported an error caused by: org jinterop. dcom. common. JIRuntimeException: Access is denied. [0x800

Visual programming - Experiment 1

Explanation keyword of MySQL
随机推荐
12. < tag linked list and common test site synthesis > - lt.234 palindrome linked list
Punch in: 4.23 C language chapter - (1) first knowledge of C language - (12) structure
Configuration table and page information automatically generate curd operation page
Knowledge of software testing~
List interface of collection
2022 团体程序设计天梯赛 模拟赛 L2-3 浪漫侧影 (25 分)
Generate QR code through zxing
TCP three handshakes and four waves
socket编程 send()与 recv()函数详解
Detailed description of MySQL index [B + tree index, hash index, full-text index, overlay index]
2022 团体程序设计天梯赛 模拟赛 L2-4 哲哲打游戏 (25 分)
QT dynamic translation of Chinese and English languages
Visual programming - Experiment 1
你真的懂hashCode和equals吗???
Problem C: realize Joseph Ring with linked list
Visual programming - Experiment 2
Test questions and some space wars
File upload vulnerability summary and upload labs shooting range documentary
浅学一下I/O流和File类文件操作
Fiddler use