当前位置:网站首页>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
边栏推荐
- 0- blog notes guide directory (all)
- Flow chart of interrupt process
- Resource arrangement
- regular expression
- Redirection setting parameters -redirectattributes
- Think about the possibility of attacking secure memory through mmu/tlb/cache
- Basic principle of bilateral filtering
- Linear, integer, nonlinear, dynamic programming
- Huawei equipment is configured with IP and virtual private network hybrid FRR
- Understanding and thinking about multi-core consistency
猜你喜欢

Laravel 权限导出

Paper reading - beat tracking by dynamic programming
![[programming idea] communication interface of data transmission and decoupling design of communication protocol](/img/cd/896d1bcad556ffcbf1007bc984afeb.jpg)
[programming idea] communication interface of data transmission and decoupling design of communication protocol

Sensor: sht30 temperature and humidity sensor testing ambient temperature and humidity experiment (code attached at the bottom)

Chapter7-13_ Dialogue State Tracking (as Question Answering)
![[pytorch] kaggle image classification competition arcface + bounding box code learning](/img/1e/5e921987754da1e1750acdadb36849.jpg)
[pytorch] kaggle image classification competition arcface + bounding box code learning

Sensor: MQ-5 gas module measures the gas value (code attached at the bottom)
![Leetcode 450. Delete node in binary search tree [binary search tree]](/img/39/d5c4d424a160635791c4645d6f2e10.png)
Leetcode 450. Delete node in binary search tree [binary search tree]

Jump model between mirrors

04路由跳转并携带参数
随机推荐
在IDEA使用C3P0连接池连接SQL数据库后却不能显示数据库内容
CCF 201409-1: adjacent number pairs (100 points + problem solving ideas)
Paper reading - beat tracking by dynamic programming
4.11 introduction to firmware image package
Thesis reading - autovc: zero shot voice style transfer with only autoencoder loss
STM32 sensorless brushless motor drive
Chapter7-10_ Deep Learning for Question Answering (1/2)
Priority queue with dynamically changing priority
在IDEA使用C3P0連接池連接SQL數據庫後卻不能顯示數據庫內容
1000粉丝啦~
Mac使用Docker安装Oracle
An image is word 16x16 words: transformers for image recognition at scale
[pytorch] kaggle image classification competition arcface + bounding box code learning
Bluetooth module: use problem collection
Branch and bound method, example sorting
Graph theory, tree based concept
too old resource version,Code:410
[pytorch] kaggle large image dataset data analysis + visualization
[work with notes] NDK compiles the open source library ffmpeg
Huawei equipment configures private IP routing FRR