You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
then I try this demo in my ios10.2 phone, <text> show me router : /
but <router-view> won't render corresponding component.
unless I add router.push('/'); in the end of app.js.
This is expected since the router is working in abstract mode in non-browser environments (node, weex, etc). In abstract mode, the router won't automatically navigate to '/' and it is required that you use router.push() to explicitly set a initial view.
This is intended - in the browser, the user may visit the non-root URL on initial load, so the root view may not get rendered at all. In abstract mode, when the application boots it will be in a "nowhere" state until you explicitly tell the router where it is. This gives you a chance to render a non-root URL as your initial view, instead of rendering the root view and then triggering a navigation + re-render.
####In weex porject.
Router must
router.push('/')
to make<router-view>
render corresponding component in ios.It's a bug or a feature?
Code
In app.js
In main-view template:
In main-view contructor Object:
then I try this demo in my ios10.2 phone,
<text>
show merouter : /
but
<router-view>
won't render corresponding component.unless I add
router.push('/');
in the end of app.js.Like this
it works.
Maybe useful
The text was updated successfully, but these errors were encountered: