mirror of
https://github.com/django-components/django-components.git
synced 2025-10-15 16:29:00 +00:00
feat: add "simple", "prepend", and "append" render types (#1156)
* feat: add "simple", "prepend", and "append" render types * refactor: explicitly set strategy for "document" in tests
This commit is contained in:
parent
e74e1241ac
commit
bf7a204e92
16 changed files with 1210 additions and 408 deletions
|
@ -107,7 +107,7 @@ class FragmentBaseHtmx(Component):
|
|||
class FragJs(Component):
|
||||
class View:
|
||||
def get(self, request):
|
||||
return FragJs.render_to_response(request=request, type="fragment")
|
||||
return FragJs.render_to_response(request=request, deps_strategy="fragment")
|
||||
|
||||
template: types.django_html = """
|
||||
<div class="frag">
|
||||
|
@ -131,7 +131,7 @@ class FragJs(Component):
|
|||
class FragAlpine(Component):
|
||||
class View:
|
||||
def get(self, request):
|
||||
return FragAlpine.render_to_response(request=request, type="fragment")
|
||||
return FragAlpine.render_to_response(request=request, deps_strategy="fragment")
|
||||
|
||||
# NOTE: We wrap the actual fragment in a template tag with x-if="false" to prevent it
|
||||
# from being rendered until we have registered the component with AlpineJS.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue