mirror of
https://github.com/django-components/django-components.git
synced 2025-08-01 12:42:16 +00:00
commit
e9929b1bff
1 changed files with 3 additions and 3 deletions
|
@ -102,7 +102,7 @@ class Calendar(component.Component):
|
||||||
"date": date,
|
"date": date,
|
||||||
}
|
}
|
||||||
|
|
||||||
def template(self, date):
|
def template(self, context):
|
||||||
return "[your app]/components/calendar/calendar.html"
|
return "[your app]/components/calendar/calendar.html"
|
||||||
|
|
||||||
class Media:
|
class Media:
|
||||||
|
@ -116,10 +116,10 @@ And voilá! We've created our first component.
|
||||||
|
|
||||||
# Use the component in a template
|
# Use the component in a template
|
||||||
|
|
||||||
First load the `django_components` tag library, then use the `component_dependencies` and `component` tags to render the component to the page.
|
First load the `component_tags` tag library, then use the `component_dependencies` and `component` tags to render the component to the page.
|
||||||
|
|
||||||
```htmldjango
|
```htmldjango
|
||||||
{% load django_components %}
|
{% load component_tags %}
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue