nuxt-community / nuxt-property-decorator

Property decorators for Nuxt (base on vue-property-decorator)
https://github.com/kaorun343/vue-property-decorator
MIT License
400 stars 34 forks source link

inject enhance? #21

Closed xiaoxiaocoder closed 5 years ago

xiaoxiaocoder commented 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 ;)

DavidBernal commented 5 years ago

Currently you can't. If you want do a PR, inject method is here

husayt commented 5 years ago

We are now using inject from vue-property-decorator and that supports default values.

@Inject(options?: { from?: InjectKey, default?: any } | InjectKey) decorator

See here