Svelte Tutorial for Beginners - Adding data to your Svelte component

Опубликовано: 08 Февраль 2026
на канале: lihautan
3,103
193

Let's add some data and use the data in the template!

Variables defined at the top-level of your script tag will be available within your template.

You can use the curly brackets {} to insert JavaScript content anywhere in your template, be it in the content or the attribute value.

Introduction 00:00
Adding data to your template 00:09
The attribute shorthand 03:40

---

💻 REPL https://svelte.dev/repl/df5dd60d0cbc4...

🎧 Svelte Tutorial for Beginners    • Svelte Tutorial for Beginners  

📚 Related Resources
Svelte https://svelte.dev
Svelte REPL https://svelte.dev/repl
Svelte Tutorial https://svelte.dev/tutorial/adding-data

🥰 Support me https://www.buymeacoffee.com/lihautan

🔗 Want to learn more from me? Check out these links:

Twitter:   / lihautan  
Blog: https://lihautan.com/
Newsletter: https://lihautan.com/newsletter

#svelte #sveltetutorial #sveltebeginner

Thanks for watching 🥰 -- with love, Li Hau