deprecated icon indicating copy to clipboard operation
deprecated copied to clipboard

Support getInitialData from mixins

Open IlyaSemenov opened this issue 7 years ago • 0 comments

It would be great if getInitialData could be pulled from mixins. For now, I have to copy/paste this to every component that needs to reuse getInitialData:

import Mixin from '...'

export default {
  mixins: [ Mixin ],
  getInitialData (context) {
    return Mixin.getInitialData (context)
  }
}

it would be also great if this inside getInitialData pointed to the component for which it is called (not the vm which is non-existent at the moment of that call, but the component options). That would allow to have several components extending a single mixin, and then refer to specific component's options from the common getInitialData coming from a mixin. (Alternatively, component may be added to context).

IlyaSemenov avatar Jun 19 '18 07:06 IlyaSemenov