Edit in JSFiddle

Vue.component('my-component', {
  template: '<h2>{{greatings}}</h2>',
  data: function () {
    return {
      greatings: 'Hello from component'
    };
  }
});

new Vue({
  el: '#app'
});
<script src='https://unpkg.com/vue@2.4.4/dist/vue.js'></script>

<div id='app'>
  <my-component></my-component>
</div>