-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4c171d4
commit 9be893c
Showing
3 changed files
with
42 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
packages/core/test/apps/basic/src/views/script-inline.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>Client assets</title> | ||
<script type="module" src="./script.ts"></script> | ||
</head> | ||
<body> | ||
<button data-testid="dec">-</button> | ||
<p data-testid="text"></p> | ||
<button data-testid="inc">+</button> | ||
|
||
<script> | ||
const inc = document.querySelector('[data-testid="inc"]'); | ||
const dec = document.querySelector('[data-testid="dec"]'); | ||
const text = document.querySelector('[data-testid="text"]'); | ||
let count = 0; | ||
inc?.addEventListener("click", () => { | ||
if (text) text.textContent = (++count).toString(); | ||
}); | ||
dec?.addEventListener("click", () => { | ||
if (text) text.textContent = (--count).toString(); | ||
}); | ||
</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters