Closed xiaoxiaocoder closed 5 years ago
If I want inject default value like this: const Child = { inject: { foo: { from: 'bar', default: 'foo' } }} How should I write it? thx ;)
const Child = { inject: { foo: { from: 'bar', default: 'foo' } }}
Currently you can't. If you want do a PR, inject method is here
We are now using inject from vue-property-decorator and that supports default values.
@Inject(options?: { from?: InjectKey, default?: any } | InjectKey) decorator
See here
If I want inject default value like this:
const Child = { inject: { foo: { from: 'bar', default: 'foo' } }}
How should I write it? thx ;)