-
-
Notifications
You must be signed in to change notification settings - Fork 8.9k
Open
Labels
Description
What problem does this feature solve?
component's keep-alive activated and deactivated hooks should also be available in directives.
For example, suppose you have a directive that adds a class based on the size of an element. When the component to which the directive is added is in a keep-alive, the directive's mounted hook will be called, even if it is not actually mounted in the DOM, and the size of the element will be zero. If we can detect that a component with a directive bound to it is now active, we can get the correct size.
Thank you!
What does the proposed API look like?
app.directive('my-directive', {
activated() { ... },
deactivated() { ... },
})
SanMurakami, YuzuRyo61, justintaddei, nokotaro, onodai145 and 21 more