mirror of
https://github.com/django-components/django-components.git
synced 2025-07-07 17:34:59 +00:00
docs: add register decorator to Calendar class in Quickstart section (#1284)
This commit is contained in:
parent
59e5fb3b38
commit
9a4f835201
3 changed files with 10 additions and 5 deletions
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue