当前位置:网站首页>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
边栏推荐
- AutoX. JS invitation code
- 0- blog notes guide directory (all)
- The precision of C language printf output floating point numbers
- Stm32+ze-08 formaldehyde sensor tutorial
- After idea uses c3p0 connection pool to connect to SQL database, database content cannot be displayed
- Leetcode 926. 将字符串翻转到单调递增 [前缀和]
- SQL Server 删除数据库所有表和所有存储过程
- Graph theory, tree based concept
- Share three stories about CMDB
- speech production model
猜你喜欢

I didn't expect that the index occupies several times as much space as the data MySQL queries the space occupied by each table in the database, and the space occupied by data and indexes. It is used i

Paper reading - jukebox: a generic model for music

Fast Color Segementation

Huffman tree and its application

Sqlserver2008 denied select permission on object'***** '(database'*****', schema'dbo')

微信云开发粗糙理解

Understand HMM
![[reading papers] transformer miscellaneous notes, especially miscellaneous](/img/c3/7788b1bcd71b90c18cf66bb915db32.jpg)
[reading papers] transformer miscellaneous notes, especially miscellaneous

Share three stories about CMDB

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%
随机推荐
Redis multiple servers share one
Paper reading - joint beat and downbeat tracking with recurrent neural networks
ROS learning-8 pit for custom action programming
[pytorch]fixmatch code explanation (super detailed)
Stm32+ze-08 formaldehyde sensor tutorial
[analysis notes] source code analysis of siliconlabs efr32bg22 Bluetooth mesh sensorclient
Laptop touch pad operation
Queuing theory, game theory, analytic hierarchy process
Basic exercises of test questions Fibonacci series
4.11 introduction to firmware image package
[dest0g3 520 orientation] dest0g3, which has been a long time since we got WP_ heap
Mac下搭建MySQL环境
Priority queue with dynamically changing priority
【 unity】 Problems Encountered in Packaging webgl Project and their resolution Records
ROS learning-6 detailed explanation of publisher programming syntax
GMM Gaussian mixture model
Think about the possibility of attacking secure memory through mmu/tlb/cache
Leetcode 926. Flip string to monotonically increasing [prefix and]
1、 Set up Django automation platform (realize one click SQL execution)
Build MySQL environment under mac