-
-
Notifications
You must be signed in to change notification settings - Fork 269
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
Provide a way to change ability for the whole nested tree of components #72
Comments
It's possible to use default |
🎉 This issue has been resolved in version 0.4.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Awesome! It's the feature I'm looking for. |
I did some investigation around Vue rendering and frankly speaking I don’t think that this case is a big issue. Here is why: When you pass slots inside a component, this component (doesn’t matter whether it’s functional or regular one) will be re-rendered together with parent component even if changes in parent doesn’t affect that child. To achieve what you want, it’s enough to convert The downsides of this are:
This actually how I implemented this in React :) so if you think it make sense then let’s do this! |
🎉 This issue has been resolved in version 0.7.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
🎉 This issue has been resolved in version 2.1.2 🎉 The release is available on: Your semantic-release bot 📦🚀 |
🎉 This issue has been resolved in version 0.4.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
🎉 This issue has been resolved in version 2.4.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
🎉 This issue has been resolved in version 0.3.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
use
inject/provide
to do thisChallenges
can
should re-render automatically when provided ability is updated:solutions:
$can
method. Requires to adddestroyed
hook and potentially may require functionalCan
component into regular one. As functional component doesn't have state.inject: ['ability']
). That's additional complexity which I'd like not to add.solutions:
vm.$ability
needs to be converted intocomputed
property (in order to have single source of truth for provided ability). This property will take value frominjections
The text was updated successfully, but these errors were encountered: