


The links in the mini program use the navigator component
Use the a tag in html, the a tag can link to any address on the network
But the navigator in the mini program can only Applied to the link jump of in the current applet <navigator url="http://www.baidu.com">跳转A</navigator>
<navigator url='test/t'>跳转B</navigator>
The first one is invalid
The second one can jump correctly, it is required Note: The page in the url cannot be the page
in tabBar (bottom menu), but you can set the
redirect attribute through the open-type attribute to open a new page When,
Close the original page(In the new page, you cannot return to the original page)<navigator redirect url='test/t'>跳转</navigator>
When jumping, pass the parameters (
No need to add quotation marks , double quotation marks will be added automatically, otherwise there will be one extra quotation mark, so directly write: id=111&name=张三):<navigator url='test/t?id=111&name=张三'>跳转</navigator>
passed
The event gets the url parameters and automatically puts the parameters into it when loading this page<navigator url='test/t?id=111&name=张三' hover-class='hoverClass'>跳转</navigator> <!--链接1-->
<navigator url='test/t?id=123&name=小明'>跳转</navigator> <!--链接2-->
Page({
data: {
},
onLoad : function(datas) {
console.log(datas);
}
})
If you click link 1, the value of datas is {id: "111", name: "张Three"}, click link 2, then the value of datas is {id: "123", name: "Xiao Ming"}
hover-class is the style after clicking on it
wx.navigateToThis Api can also complete page jump, which is the same as navigator (without redirect attribute)
<button size='mini' bindtap="navigator">跳转</button>
navigator : function() { wx.navigateTo({ url: 'test/t?id=100&user=xiaoming', success : function(e) { console.log(e.errMsg); } }) }wx.redirectTo
This Api can also complete page jump, which is the same as navigator (with redirect attribute), and the operation is the same as above
wx.navigateBackThis Api is used to return , Return to the upper-level page from the current page (according to the following parameters)
Page({ data: { }, back : function() { wx.navigateBack({ delta : 1 // 值为1, 则是返回上一级, 值为2就返回上两级... }) } })
If the value of dellta is 1, you do not need to write the dellta attribute: wx.navigateBack({})
If the value of dellta If the value exceeds the total level that
can be returned, it will return to the home pageRelated articles:
Link to this pageWeChat Mini Program Component: Navigator Page Link Interpretation and Analysis Page Links and Multimedia-WeChat Mini Program Program project practical video tutorialThe above is the detailed content of How to jump to a specified mini program page from outside the mini program_get the link from the mini program page. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Safe Exam Browser
Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

SublimeText3 English version
Recommended: Win version, supports code prompts!

MinGW - Minimalist GNU for Windows
This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

Dreamweaver CS6
Visual web development tools
