当前位置:网站首页>04 route jump and carry parameters
04 route jump and carry parameters
2022-06-13 02:27:00 【JSONP$】
04 The route jumps and carries parameters
First write a button Button , Bind an event to it
<button bindtap="skip" type="primary"> Jump </button>
Then bind a parameter for him
<button bindtap="skip" type="primary" data-name=" Zhu Yuan "> Jump </button>
Then write jump logic for this event
skip(){
wx.navigateTo({
url: '/pages/logs/logs'
})
},
Be careful !!! In actual development, we will encounter , A particularly curious question , That is, your paths are all written to , The jump mode is also written against , But I still can't jump . This is because there is a cache , Or not updated in time , We can clearly cache , And re import this project , It's back to normal , This is also a part of wechat applet bug. Or you don't do anything , Wait for more than ten minutes , The jump function of this item can also return to normal .
Let's see how to implement the parameter carrying function , Because in html page , We have carried a parameter in the following way , We now need to pass this parameter to the page after jump
data-name=" Zhu Yuan "
Let's look at the following actual code
Insert a code chip here
Be sure to open the domain name that is not verified as legal , Otherwise, there is no way to get the carried parameters
Be careful ! At this point, if there is bug, We need to close this project , Then re import the following , In this way, wechat applet developer tools are sometimes quite lame . We can achieve a re import effect by debugging the basic library
then , We can get this parameter on another page
onLoad: function (options) {
console.log(options.name);
},
Wechat applet has also prepared a special label for us to realize jump
<navigator open-type="navigate" url="pages/index/index"> Jump </navigator>
open-type This attribute can be left blank , The default is navigate
So how to pass on parameters ?
<navigator open-type="navigate" url="pages/index/index?id=1"> Jump </navigator>
Receive this parameter from another page , The same way
onLoad: function (options) {
console.log(options.name);
},
Recently, many problems have been found in the code , The latest version of wechat developer tool has been solved
That is, your paths are all written to , The jump mode is also written against , But I still can't jump
This problem , No need to reload the project , It's not going to happen bug 了 , But the latest version of wechat developer tools can not be used perfectly vant Component library , This is very uncomfortable , Because it doesn't have
Use npm modular
This option
边栏推荐
- Chapter7-12_ Controllable Chatbot
- Configuring virtual private network FRR for Huawei equipment
- Chapter7-13_ Dialogue State Tracking (as Question Answering)
- Leetcode 450. Delete node in binary search tree [binary search tree]
- SQL server deletes all tables and all stored procedures in the database
- Introduction to arm Cortex-M learning
- Linear, integer, nonlinear, dynamic programming
- Is space time attention all you need for video understanding?
- 4.11 introduction to firmware image package
- 05 tabBar导航栏功能
猜你喜欢
Armv8-m learning notes - getting started
Solution of depth learning for 3D anisotropic images
Bai ruikai Electronic sprint Scientific Innovation Board: proposed to raise 360 million Funds, Mr. And Mrs. Wang binhua as the main Shareholder
An image is word 16x16 words: transformers for image recognition at scale
1、 Set up Django automation platform (realize one click SQL execution)
Cumulative tax law: calculate how much tax you have paid in a year
Installing Oracle with docker for Mac
拍拍贷母公司信也季报图解:营收24亿 净利5.3亿同比降10%
Leetcode 473. 火柴拼正方形 [暴力+剪枝]
Graph theory, tree based concept
随机推荐
Build MySQL environment under mac
在IDEA使用C3P0連接池連接SQL數據庫後卻不能顯示數據庫內容
Paipai loan parent company Xinye quarterly report diagram: revenue of RMB 2.4 billion, net profit of RMB 530million, a year-on-year decrease of 10%
Bai ruikai Electronic sprint Scientific Innovation Board: proposed to raise 360 million Funds, Mr. And Mrs. Wang binhua as the main Shareholder
Laravel permission export
[analysis notes] source code analysis of siliconlabs efr32bg22 Bluetooth mesh sensorclient
[reading point paper] deeplobv3+ encoder decoder with Atlas separable revolution
Deep learning the principle of armv8/armv9 cache
Think: when do I need to disable mmu/i-cache/d-cache?
CCF 201409-1: adjacent number pairs (100 points + problem solving ideas)
Understand CRF
Armv8-m (Cortex-M) TrustZone summary and introduction
[reading point paper] deeplobv3 rethinking atlas revolution for semantic image segmentation ASPP
Graph theory, tree based concept
[reading papers] comparison of deeplobv1-v3 series, brief review
Microsoft Pinyin opens U / V input mode
Redis multiple servers share one
Huawei equipment configures private IP routing FRR
Chapter7-13_ Dialogue State Tracking (as Question Answering)
Impossible d'afficher le contenu de la base de données après que l'idée a utilisé le pool de connexion c3p0 pour se connecter à la base de données SQL