-
Notifications
You must be signed in to change notification settings - Fork 20
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
Mixin pattern use case #45
Comments
Look like there are some other failing MRO use cases. @stefanhoelzl, is interesting for you? or may be you don't plan to make |
Please refer to the Mixins section in the documentation. It re-assembles the |
Unfortunately both |
There are no plans, in fact I do not work actively on vue.py anymore. Only take care of small bugs, if someone reports, like you did. I guess adding MRO might not be so easy, if not impossible. Feel free to open tickets for issues you find, or even try to fix them. But I can't spend too much time digging into them. |
Thanks, looks like I am going to play around with it. class MyMixin1(VueMixin):
@computed
def value1(self):
return 'value1'
class MyMixin2(VueMixin):
@computed
def value2(self):
return 'value3 ' + super().value2()
class MyMixin3(MyMixin2):
@computed
def value3(self):
return 'value3 ' + super().value2()
class MyMixin4(MyMixin1, MyMixin3):
template = '<b>{{value1}}, {{value2}}, {{value3}}</b>'
class SomeComponent(VueComponent):
mixins = [MyMixin4] BTW. I've tried to dive into your code but, but unfortunately couldn't figure out the logic of bunch of factories and decorators. It would be nice to have some design describing docstrings. |
FYI: just pushed some changes to master, renaming |
I've tested latest master changes with Mixin pattern (Regular Python mixins). Looks like only
VueComponent
children could be used as Mixins. Is it expected behaviour?Error:
The text was updated successfully, but these errors were encountered: