Description
Hello!
First of all, I'd want to thank you for providing this great library.
After creating few projects with Vue I've came across an idea - could it be possible to allow using ES6 classes in place of standard Vue component syntax?
I think we already have a nice ES6 standard for classes so using these would be ideal because code would become less framework-dependent, more readable (esp. for people who never were using Vue), I believe that also less error-prone and more versalite.
It could look like this way:
http://pastebin.com/mqy2r2XW
This is how it worked in for example KnockoutJS. They werent making their own way of declaring component, properties, methods as JS nested objects, they've used standaard javascript class syntax instead.
I've managed to make it this way using some hacky module (that translates a class into structure readable by Vue) but it'd be great to have this as build-in functionality.
My proposal is to tune up component builder in Vue - for now it only accepts JS objects with Vue declarations like props, methods etc. For backwards compatibility it could work this way:
a) if object is passed to Vue.component then it works using original behaviour
b) if function is passed, Vue.component treats it as class constructor and uses new syntax.
It could be nice, modular and simplier, I'd love to use:
import SomeComponentClass from 'components/some-component.js';
Vue.component( 'some-component' , SomeComponentClass );
Or just return it from .vue file via vue-lodaer/vueify.