You have to either create your Vue.component
before the creation of the Vue ViewModel, that is before the new Vue({})
, or create your Vue.component
inside the ViewModel in created
event.
Here is jsfiddle with the first approach and here is jsfiddle showing the second approach.