Edit in JSFiddle

var myComponent =  {
  template: '<h2>{{greatings}}</h2>',
  data: function () {
    return {
      greatings: 'Hello from component'
    };
  }
};

new Vue({
  el: '#app',
  components: {
    'my-component': myComponent
  }
});

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

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

<hr />

<div id='app2'>
  <h1>App2</h1>
  <my-component></my-component>
</div>