mirror of
https://gitcode.com/gh_mirrors/se/Semi.Avalonia
synced 2026-04-12 20:26:35 +08:00
feat: add sample in web app.
This commit is contained in:
16
demo/Semi.Avalonia.Demo.Web/AppBundle/main.js
Normal file
16
demo/Semi.Avalonia.Demo.Web/AppBundle/main.js
Normal file
@@ -0,0 +1,16 @@
|
||||
import { dotnet } from './dotnet.js'
|
||||
import { registerAvaloniaModule } from './avalonia.js';
|
||||
|
||||
const is_browser = typeof window != "undefined";
|
||||
if (!is_browser) throw new Error(`Expected to be running in a browser`);
|
||||
|
||||
const dotnetRuntime = await dotnet
|
||||
.withDiagnosticTracing(false)
|
||||
.withApplicationArgumentsFromQuery()
|
||||
.create();
|
||||
|
||||
await registerAvaloniaModule(dotnetRuntime);
|
||||
|
||||
const config = dotnetRuntime.getConfig();
|
||||
|
||||
await dotnetRuntime.runMainAndExit(config.mainAssemblyName, [window.location.search]);
|
||||
Reference in New Issue
Block a user