Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

inject enhance? #21

Closed
xiaoxiaocoder opened this issue Nov 25, 2018 · 2 comments
Closed

inject enhance? #21

xiaoxiaocoder opened this issue Nov 25, 2018 · 2 comments
Milestone

Comments

@xiaoxiaocoder
Copy link

xiaoxiaocoder commented Nov 25, 2018

If I want inject default value like this:
const Child = { inject: { foo: { from: 'bar', default: 'foo' } }}
How should I write it? thx ;)

@DavidBernal
Copy link
Member

DavidBernal commented Nov 30, 2018

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

@husayt
Copy link
Collaborator

husayt commented Feb 26, 2019

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

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

See here

@husayt husayt closed this as completed Feb 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants