fast lint
This commit is contained in:
parent
11f7aef552
commit
1adf2fb862
9 changed files with 47 additions and 231 deletions
10
src/components/login.svelte
Normal file
10
src/components/login.svelte
Normal file
|
@ -0,0 +1,10 @@
|
|||
<script>
|
||||
function login() {
|
||||
globalThis.user = { name: 'John Doe' };
|
||||
console.log('User logged in:', globalThis.user);
|
||||
}
|
||||
</script>
|
||||
|
||||
<button onclick={login}> Login </button>
|
||||
|
||||
<button type="button" onclick={(e) => console.log(e)}> login2 </button>
|
|
@ -2,7 +2,14 @@
|
|||
import './index.css';
|
||||
import Header from './components/header.svelte';
|
||||
import Main from './components/main.svelte';
|
||||
import Login from './components/login.svelte';
|
||||
</script>
|
||||
|
||||
<Header></Header>
|
||||
<Main></Main>
|
||||
<Main>
|
||||
{#if !globalThis.user}
|
||||
<Login></Login>
|
||||
{:else}
|
||||
{globalThis.user.name}
|
||||
{/if}
|
||||
</Main>
|
||||
|
|
|
@ -4,6 +4,7 @@ import './index.css';
|
|||
|
||||
declare global {
|
||||
var didMount: boolean | undefined;
|
||||
var user: { name: string } | undefined;
|
||||
}
|
||||
|
||||
let app: Record<string, any> | undefined;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue