mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-16 03:31:45 +08:00

* feat: Frame replacePage by entry * feat(webpack): improved svelte HMR (#9497) * update svelte config to use svelte-loader * handle null config * fix: worker support in .svelte files & update snapshots * fix after merge Co-authored-by: halfnelson <dpershouse@gmail.com> Co-authored-by: Igor Randjelovic <rigor789@gmail.com> * feat(webpack): use svelte-loader and fallback to svelte-loader-hot Allows running older projects * feat: allow overwriting replacePage transition Co-authored-by: farfromrefuge <martin.guillon@akylas.fr> Co-authored-by: halfnelson <dpershouse@gmail.com>
Use the frame in the following way:
To navigate to the starting page of the application
// put this in the bootstrap.js
var app = require("application");
var frameModule = require("ui/frame");
app.onLaunch = function(context) {
var frame = new frameModule.Frame();
frame.navigate("testPage");
}
// or use the mainModule property of the application module
// in this a Frame instance is internally created and used to navigate to the main page module
app.mainModule = "testPage";
To navigate to a new Page
// take the frame from an existing (and navigatedTo) Page instance
var frame = page.frame;
frame.navigate("newPage");
To navigate to a new Activity (Android)
// create a new Frame instance
var frameModule = require("ui/frame");
var frame = new frameModule.Frame();
frame.navigate("newPage");