WeChat mini-program Development Guide Series: page jump

Source: Internet
Author: User
This article introduces the mini-program Development Guide Series: page jump from the jump method (or the way to open a new page) can be roughly divided into: request forwarding, request redirection and TAB page jump (if you have web experience, you should be clear about the difference between the two methods), part of which is from the official documentation.

Wx. navigateTo (OBJECT)

Retain the current page and jump to a page in the application. you can use wx. navigateBack to return to the original page.

Wx. navigateTo (OBJECT)

1. here we need to emphasize that the page is recorded as a stack in a applet. Every page redirected in wx. navigateTo (OBJECT) mode will be pushed into the stack, but the page opened in wx. redirectTo (OBJECT) will not. The official example is clear and clear.

// Here is wx. navigateTo ({url: 'B? Id = 1 '}) // The wx. redirectTo ({url: 'C? Id = 1 '}) // navigateBack on page C. The wx. navigateBack () on page A is returned ()

** 2. ** wx. navigateTo and wx. redirectTo are not allowed to jump to the tabbar page. only wx. switchTab can be used to jump to the tabbar page.

There are roughly two types of writes: One is the tag format in the wxml file on the page and the other is the code format (as listed above, ).

Component navigator page link.

The above error reported aboutUs is another tab on the home page. it is only a display page and has no operation. Therefore, although an error is reported, I did not care about it. The problem is that when I jump to pages/map (detailed map), I am prompted for the error of the last line above.

Page[pages/map/map] not found. May be caused by: 1. Forgot to add page route in app.json. 2. Invoking Page() in async task.

Based on my previous experience in Android and the background, I have been positioning the problem to the map page itself. It has not been solved after N years. Afterwards, aboutUs's exception was solved with painstaking efforts, and the problem was solved miraculously.

The problem lies in the aboutUs page. aboutUs. js is empty because it is only a static page and has no operations.

In a small program, JavaScript code does not need to be written immediately. Page ({}) must be added to the js file ({}).

The above is the mini-program Development Guide Series: for details about page jump, please pay attention to other related articles in the first PHP community!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.