As we all know, in the browser, you can switch between pages using the forward and back buttons. The iOS/Android Navigator module is designed to achieve a similar effect. In addition to the forward and backward functions, this module also allows us to specify whether or not to apply animation effects when switching pages.
Usage:
The navigator. Push ({url: 'http://192.168.1.141:8080/index.js', animated:' true '}, event = > {modal. Toast ({message: 'the callback: '+event}) })Copy the code
1. The URL here is the same as the A component of the last blog. It must also be the network path of THE WEEX JS file. 2. The cause of the crash is animated, which most people assume is a Boolean, which is animated. If aniated:true is written as aniated:true, the type error will be reported in the emulator or the real script, resulting in a crash. According to the official website, this is a string, so both true and false should be written as strings to avoid crashes.