Skip to content

Use nuxt-property-decorator instead vue-property-decorator in examples #58

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

Closed
SyloRei opened this issue Aug 19, 2019 · 4 comments
Closed
Labels
feature request Feature request

Comments

@SyloRei
Copy link

SyloRei commented Aug 19, 2019

Is your feature request related to a problem? Please describe.
In the class-api examples, the vue-property-decorator library was used. But this library does not contain all the parameters of the nuxt components.

Describe the solution you'd like
Use nuxt-property-decorator in examples. It is clearer for nuxt.

@SyloRei SyloRei added the feature request Feature request label Aug 19, 2019
@NickBolles
Copy link

I'm pretty sure nuxt-property-decorator doesn't have any benefits over vue-property-decorator. Nuxt registers the hooks, which is essentially all that nuxt-property-decorator does, and re-exports everything from vue-property-decorator.

@SyloRei
Copy link
Author

SyloRei commented Aug 20, 2019

I'm pretty sure nuxt-property-decorator doesn't have any benefits over vue-property-decorator. Nuxt registers the hooks, which is essentially all that nuxt-property-decorator does, and re-exports everything from vue-property-decorator.

You are right, but when the application grows out of the current example / template and requires, for example, fetch or asyncData hook, the user of this example will be confused. Maybe he does not know about nuxt-property-decorator library.

@kevinmarrec
Copy link
Contributor

kevinmarrec commented Aug 20, 2019

@SyloRei Basic & Avanced examples that will be available here will showcase the use of fetch and asyncData around the component options.

Something you might not be aware is that layout for example can be either a string or function, and when you want it to be a string, defining a property layout within the class won't work, you'll need to give it to the component options. And I think this behavior is more likely to happen and bring more confusion than not talking about nuxt-property-decorator in first instance.

Furthermore, nuxt-property-decorator is, as said @NickBolles , kind of wrapper as it re-export everything and just register hooks. It also provide new decorators, and in the case they could be useful, the user can chose to use nuxt-property-decorator but they need to be aware that the package may not be released as fast as a new vue-property-decorator release comes out.

@SyloRei
Copy link
Author

SyloRei commented Aug 22, 2019

I agree, let's close

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Feature request
Projects
None yet
Development

No branches or pull requests

3 participants