AAAA pschyho
This commit is contained in:
21
src/main.ts
21
src/main.ts
@@ -1,9 +1,18 @@
|
||||
import { mount } from 'svelte'
|
||||
import './app.css'
|
||||
import App from './App.svelte'
|
||||
import { mount } from "svelte";
|
||||
import "./app.css";
|
||||
import HomePage from "./routes/+page.svelte";
|
||||
import HeartPage from "./routes/heart/+page.svelte";
|
||||
|
||||
const routes: Record<string, typeof HomePage> = {
|
||||
"/": HomePage,
|
||||
"/heart": HeartPage,
|
||||
};
|
||||
|
||||
const normalizedPath = window.location.pathname.replace(/\/+$/, "") || "/";
|
||||
const App = routes[normalizedPath] ?? HomePage;
|
||||
|
||||
const app = mount(App, {
|
||||
target: document.getElementById('app')!,
|
||||
})
|
||||
target: document.getElementById("app")!,
|
||||
});
|
||||
|
||||
export default app
|
||||
export default app;
|
||||
|
||||
Reference in New Issue
Block a user