Is it possible to nest unicorn views? #615
Unanswered
Maxtrix-dev
asked this question in
Q&A
Replies: 1 comment
-
|
Hi, I assume you have you looked through these docs? There are definitely some "gotchas" with nesting components, but they should work. Some example code of nested components is here: https://github.com/adamghill/django-unicorn/tree/main/example/unicorn/templates/unicorn/nested. If you create a repo that replicates your issue with sample code that I can run, I can probably help get something working. 👍 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I have a problem with nesting unicorn views.
My
Layout.html(the first unicorn view) looks like this (this si the only important part this unicorn view works fine):{% elif pageIndex == 2 %} {% unicorn 'Modules' %}And my
Modules.htmllooks like this (this is the second unicorn view where the unicorn:click doesn't work):{% load unicorn %} <div> {% unicorn_scripts %} {{modules}} <button u:click="testThis()">test</button> </div>and my
Modules.pylooks like this:from django_unicorn.components import UnicornView class ModulesView(UnicornView): modules="SRT" def testThis(self): print("test This") def mount(self): print("mounted") return super().mount()It mounts but the click doesn't work do you anyone have any suggestion / author should it even work?
Beta Was this translation helpful? Give feedback.
All reactions