This is a simple enough one, but I\'m not getting the answer I need from the documentation. I\'m in the process of learning Vue.js, and I don\'t really understand where Vue.
There guide in previous Vuejs.org site had a document.
Copy from http://optimizely.github.io/vuejs.org/guide/composition.html which is forked from vuejs/Vuejs.org at version 0.10.6 of Vuejs.
It is important to understand the difference between
Vue.extend()
andVue.component()
. SinceVue
itself is a constructor,Vue.extend()
is a class inheritance method. Its task is to create a sub-class ofVue
and return the constructor.Vue.component()
, on the other hand, is an asset registration method similar toVue.directive()
andVue.filter()
. Its task is to associate a given constructor with a string ID so Vue.js can pick it up in templates. When directly passing in options toVue.component()
, it callsVue.extend()
under the hood.Vue.js supports two different API paradigms: the class-based, imperative, Backbone style API, and the markup-based, declarative, Web Components style API. If you are confused, think about how you can create an image element with
new Image()
, or with antag. Each is useful in its own right and Vue.js tries to provide both for maximum flexibility.