Usage: used for page jump, equivalent to the tag in html. This article mainly shares with you four methods of page jumps in developing WeChat mini programs from scratch (6). I hope it can help you.
(Note, When there is no bottom navigation set, this attribute can also be used without tabs. If there is a tab page, the switchTab attribute needs to be replaced)
<view> <navigator url="/pages/logs/logs" hover-class="changestyle">页面跳转,可以返回</navigator></view>
(Note that if the bottom navigation is not set, this attribute can be used without tabs. If there is a tab page, the switchTab attribute needs to be replaced)
<view> <navigator url="/pages/logs/logs" hover-class="changestyle" redirect>页面跳转,无法返回</navigator></view>
on the current page and create a new folder, name it no, complete the wxml test information inside, and fill in the content at will to facilitate testing
<view class="btn-area"> <navigator url="/pages/test/test" hover-class="navigator-hover">我是一个自由分散的页面哦</navigator> </view>
Open the global app.json file and write the path of the newly created folder no into the
We now want to test opening from the link on the home page. Click the link to open the no page on the current home page.
代码<view><navigator url="/pages/logs/logs" open-type="switchTab" hover-class="other-navigator-hover">切换 Tab</navigator></view>
Reason: All page paths need to be configured in the tabBar under pages. There are generally four main pages. The jumps between these main pages are like tab switching. These pages need to be configured separately in the tabBar. Ordinary pages go here. When jumping to the four main pages, navigator cannot be used and switchTab must be used.
Experience summary: When configuring the pagePath of the list item in the TabBar, try not to use it as a jump link to other pages.
The above is the detailed content of Develop 4 methods of page jumps in WeChat mini programs from scratch (6). For more information, please follow other related articles on the PHP Chinese website!