3 ms·
> Here's a discussion on class syntax in Vue: https://github.com/vuejs/vue/issues/2371 https://github.com/vuejs/vue/issues/2371 This is the typical answer from
by pier25 8y ago
> Here's a discussion on class syntax in Vue: https://github.com/vuejs/vue/issues/2371 https://github.com/vuejs/vue/issues/2371
This is the typical answer from the Vue team.
I've had a number of (civilized) discussions with them on other issues and it always ends up with "you are holding it wrong" or "this is not an issue".
I won't argue classes vs objects, both have pros and cons, but locking the issue when there is clearly a boilerplate problem with Vue is bit ridiculous.
- likeclockwork 8y agoFrom your article: > My point here is not about using classes or not, but that Vue is using arbitrary object structures instead of language features. Which language features do you think they should be used that they aren't being used now? Your class example doesn't express the same things that Vue's object structure can. Object literals are an important, useful, and universal feature of JS. Class syntax doesn't really replace them. I'd really like to know what your alternative is.
- pier25 8y agoThere are some good proposals in the Github issue you linked but again, I'm not arguing in favor of classes vs objects. For example it would be possible to simply use an object with regular functions for methods, getters and setters for computed properties and watchers, and regular variables for data. That would solve 90% of Vue's boilerplate problem.