当前位置:网站首页>Wechat applet returns to the previous page and transfers parameters
Wechat applet returns to the previous page and transfers parameters
2022-06-10 14:32:00 【yechaoa】
itemClick: function(e) {
let pages = getCurrentPages();
let prevPage = pages[pages.length - 2];
prevPage.setData({
message: e.currentTarget.dataset.msg,
})
wx.navigateBack({
delta: 1,
})
},getCurrentPages()Function to get an instance of the current page stack , Given as an array in the order of stackspages[pages.length - 2]It's the last page ,-1 It's the current page- Then directly call the... On the previous page
setDataMethod messageIs the variable defined on the previous page ,e.currentTarget.dataset.msgData to be transferred for the current page- And then call
wx.navigateBackreturn ,delta Indicates the number of pages returned , IfdeltaGreater than the number of existing pages , Then go back to the home page .
Wechat applet Close current page
边栏推荐
- QT interface nested movement based on qscrollarea
- 【原创】POI 5.x XSSF和HSSF使用自定义字体颜色
- 2022危险化学品经营单位主要负责人考试题库及在线模拟考试
- Ue5 how to convert screen coordinates to world coordinates and World Directions
- QT transfers the received JSON data (including Chinese) Unicode to utf8
- 【离散数学期复习系列】四、图
- What is CAS and ABA in CAS
- Flutter drawer learning summary 6
- JMeter 中如何实现接口之间的关联?
- C multithreading learning note 2
猜你喜欢

北京/上海内推 | 微软亚洲研究院系统与网络组招聘全职实习生

Allan variance and random error identification

SIGIR 2022 | HKU and Wuhan University put forward kgcl: a recommendation system based on knowledge map comparative learning

CVPR 2022 | frame by frame motion representation of long video based on sequence contrast learning

Mutual transformation among lists, arrays and tensors

How to build Haojing technology when the computing power network is brought into reality?

【離散數學期複習系列】二、一階邏輯(謂詞邏輯)

UE5如何將屏幕坐標轉為世界坐標和世界方向

【LogoDetection 数据集处理】(2)画出训练集图片的标注框

The interview at the big factory was held at 10:00 a.m. and came out at 10:09 a.m. the question was really too
随机推荐
初试c语言之第二次笔记
Gorm set foreign key
数仓的基本概念
[discrete mathematics review series] i. propositional logic
洞见科技入选「爱分析· 隐私计算厂商全景报告」,获评金融解决方案代表厂商
北京/上海内推 | 微软亚洲研究院系统与网络组招聘全职实习生
what‘t the meaning of “de facto“
微信小程序 关闭当前页面
Even some people say that ArrayList is twice as large. Today, I will take you to tear up the ArrayList source code
2022第十四届南京国际人工智能产品展会
Generate a dataset of training vectors for doc2vec
The interview at the big factory was held at 10:00 a.m. and came out at 10:09 a.m. the question was really too
QT将接收到的json数据(含中文)unicode转utf8
ScrollView 初始化的时候不在最顶部?
[C language] pointer function, function pointer and array function
How to build Haojing technology when the computing power network is brought into reality?
[advanced MySQL] optimize SQL by using the execution plan explain (2)
[notes] notes on C language array pointer, structure + two-dimensional array pointer
Design tools and skills for beginners to build their own blog
[logodetection dataset processing] (4) extract the logo area of each picture