New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add vue-router helper classes and example #37
Conversation
trame/html/router/__init__.py
Outdated
class RouterView(AbstractElement): | ||
def __init__(self, children=None, **kwargs): | ||
super().__init__("router-view", children=children, **kwargs) | ||
self._attr_names += [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can remove that line self._attr_names += []
trame/layouts/core.py
Outdated
"name": name, | ||
"path": path, | ||
"component": { | ||
"template": template.html, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You may want to defer the template.html
evaluation to later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe you just pass the template
to template and you do a pass somewhere in layout.start to eval to html any isinstance(template, AbstractElement)
.
BTW, I love the idea! |
46d57ab
to
f3f6c60
Compare
f3f6c60
to
7f4b776
Compare
I guess, you just need to resolve the conflict. Otherwise it looks good. |
Thank you for the review, @jourdain :) |
Thanks for your contribution! |
🎉 This PR is included in version 1.14.0 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
BTW, don't forget to merge the PR for py-web-vue as well, since this PR depends on it. |
Simple demo to use the Vue-Router in Trame to create multi-page applications.
I suggest two ways to add a new route.
layout.add_route
andlayout.with_route
. See the example.Any more/other suggestions?
(Depends on this PR in py-web-vue: Kitware/py-web-vue#11)