Created
January 30, 2023 08:42
-
-
Save xsonic/7d3ecdd1e03d209e7fba0997db325ee6 to your computer and use it in GitHub Desktop.
Svelte single file app
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
<!-- index.html --> | |
<!doctype html> | |
<html> | |
<head> | |
<title>My Svelte App</title> | |
</head> | |
<body> | |
<script src="https://cdn.jsdelivr.net/npm/svelte@3/compiler.js"></script> | |
<script> | |
// Create a new Svelte component | |
const app = new Svelte({ | |
target: document.body, | |
data: { | |
message: 'Hello, World!' | |
}, | |
// Add a template | |
template: ` | |
<h1>{{message}}</h1> | |
` | |
}); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment