refactor: Use top-level exports as public API (#562)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
Juro Oravec 2024-08-03 08:30:39 +02:00 committed by GitHub
parent d819f3ff49
commit e771a0aaaf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
30 changed files with 615 additions and 598 deletions

View file

@ -15,12 +15,14 @@
And components that make use of `abc.html` via `include` or `extends`:
```py
@component.register("my_comp_extends")
class MyCompWithExtends(component.Component):
from django_components import Component, register
@register("my_comp_extends")
class MyCompWithExtends(Component):
template = """{% extends "abc.html" %}"""
@component.register("my_comp_include")
class MyCompWithInclude(component.Component):
@register("my_comp_include")
class MyCompWithInclude(Component):
template = """{% include "abc.html" %}"""
```
@ -61,8 +63,8 @@
and component `my_comp`:
```py
@component.register("my_comp")
class MyComp(component.Component):
@register("my_comp")
class MyComp(Component):
template_name = "abc.html"
```
@ -108,8 +110,8 @@
`abc.html` will render `OVERRIDEN`:
````py
@component.register("my_comp")
class MyComp(component.Component):
@register("my_comp")
class MyComp(Component):
template_name = """
{% extends "abc.html" %}
@ -125,8 +127,8 @@
new `slots` inside these "overriding" blocks:
```py
@component.register("my_comp")
class MyComp(component.Component):
@register("my_comp")
class MyComp(Component):
template_name = """
{% extends "abc.html" %}