use body as target
This commit is contained in:
@@ -1,12 +1,11 @@
|
|||||||
<!DOCTYPE html>
|
<!doctype html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8" />
|
<meta charset="UTF-8" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
<title>Svelte-Tauri</title>
|
<title>Svelte-Tauri</title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body id="app">
|
||||||
<div id="app"></div>
|
|
||||||
<script type="module" src="/src/main.ts"></script>
|
<script type="module" src="/src/main.ts"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -1,14 +1,16 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { theme } from '$lib/stores/theme';
|
import Router from '$router/Router.svelte'
|
||||||
import Router from '$lib/router/Router.svelte';
|
import { ModeWatcher, mode } from 'mode-watcher'
|
||||||
import BaseLayout from '$lib/layout/BaseLayout.svelte';
|
import Header from '$lib/components/HeaderNav.svelte'
|
||||||
|
import { Toaster } from 'svelte-sonner'
|
||||||
$: {
|
|
||||||
document.documentElement.setAttribute('data-theme', $theme);
|
|
||||||
document.documentElement.classList.value = $theme;
|
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<BaseLayout>
|
<ModeWatcher defaultMode="dark" />
|
||||||
<Router />
|
<Toaster theme={$mode} />
|
||||||
</BaseLayout>
|
|
||||||
|
<div class="relative flex flex-col h-screen" data-vaul-drawer-wrapper id="page">
|
||||||
|
<Header />
|
||||||
|
<main class="flex-1">
|
||||||
|
<Router />
|
||||||
|
</main>
|
||||||
|
</div>
|
||||||
|
|||||||
17
src/main.ts
17
src/main.ts
@@ -1,15 +1,16 @@
|
|||||||
import './styles.pcss';
|
import './styles.postcss'
|
||||||
import App from './App.svelte';
|
import App from './App.svelte'
|
||||||
|
|
||||||
const target = document.getElementById('app');
|
const target = document.getElementById('app')
|
||||||
if (!target)
|
if (!target) {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
"The element with id of 'app' wasn't found on the base html file."
|
"The element with id of 'app' was not found on the base html file. Create that element and try again"
|
||||||
);
|
)
|
||||||
|
}
|
||||||
|
|
||||||
const app = new App({
|
const app = new App({
|
||||||
target,
|
target,
|
||||||
intro: true
|
intro: true
|
||||||
});
|
})
|
||||||
|
|
||||||
export default app;
|
export default app
|
||||||
|
|||||||
Reference in New Issue
Block a user