I have some case, when it will be very useful: fiddle
In this case creation of properties in constructor by custom function like:
computed { ...putSomeProps() }
does not fit, because there used information, created with inheritance chain of components.
And may be it will also useful in the case of vuex store bindings.
computed() {
return {prop1() {...}}
}
I don't see any benefits from this feature and it seems a lot complex compared to current API.
Ha, I thought about this when I saw at #5237 but I think that if your computed functions cannot be defined right away and therefore depends on some external state to the component, they don't belong to that component
IMHO, component definition is designed to be static. For example, you cannot dynamically add methods , nor can you add reactive data fields on root after initialization. Adding this API would promote very high dynamism to Vue, which I'm skeptical about its benefit.
Users can simply return a dynamic object definition for a dynamic component. That's fairly easy.
I don't really think this is a good idea, largely what @HerringtonDarkholme has pointed out.
Most helpful comment
Ha, I thought about this when I saw at #5237 but I think that if your computed functions cannot be defined right away and therefore depends on some external state to the component, they don't belong to that component