mirror of
https://github.com/django-components/django-components.git
synced 2025-08-30 18:57:20 +00:00
Update docs to latest version of API.
This commit is contained in:
parent
666c4f70a8
commit
1d2a8a6909
1 changed files with 2 additions and 2 deletions
|
@ -23,13 +23,13 @@ class Calendar(component.Component):
|
|||
css = {'all': ('[your app]/components/calendar/calendar.css',)}
|
||||
js = ('[your app]/components/calendar/calendar.js',)
|
||||
|
||||
component.register(name="calendar", component=Calendar)
|
||||
component.registry.register(name="calendar", component=Calendar)
|
||||
```
|
||||
|
||||
In your templates, use your component by first importing the django_components tag library, and then using the component_dependencies and component tags to render the component to the page.
|
||||
|
||||
```htmldjango
|
||||
{% load components %}
|
||||
{% load django_components %}
|
||||
{% block extra_media %}{% component_dependencies %}{% endblock %}
|
||||
{% block main %}
|
||||
{% component name="calendar" date=custom_date %}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue