docs: add register decorator to Calendar class in Quickstart section

This commit is contained in:
antoliny0919 2025-07-04 08:38:02 +09:00
parent 59e5fb3b38
commit 00d8720bd6
3 changed files with 10 additions and 5 deletions

View file

@ -24,8 +24,9 @@ A component in django-components can be as simple as a Django template and Pytho
```py
# components/calendar/calendar.py
from django_components import Component
from django_components import Component, register
@register("calendar")
class Calendar(Component):
template_file = "calendar.html"
```
@ -56,8 +57,9 @@ document.querySelector(".calendar").onclick = () => {
```py
# components/calendar/calendar.py
from django_components import Component
from django_components import Component, register
@register("calendar")
class Calendar(Component):
template_file = "calendar.html"
js_file = "calendar.js"

View file

@ -35,8 +35,9 @@ document.querySelector(".calendar").onclick = function () {
```
```py title="calendar.py"
from django_components import Component
from django_components import Component, register
@register("calendar")
class Calendar(Component):
template_file = "calendar.html"
js_file = "calendar.js"

View file

@ -18,8 +18,9 @@ A component in django-components can be as simple as a Django template and Pytho
```
```py title="components/calendar/calendar.py"
from django_components import Component
from django_components import Component, register
@register("calendar")
class Calendar(Component):
template_file = "calendar.html"
```
@ -46,8 +47,9 @@ document.querySelector(".calendar").onclick = () => {
```
```py title="components/calendar/calendar.py"
from django_components import Component
from django_components import Component, register
@register("calendar")
class Calendar(Component):
template_file = "calendar.html"
js_file = "calendar.js"