title: Vue.JS import custom module
body: <p>I have created a module <em>greatings.js</em> like this one:</p>
  <pre><code>function greatings() {
    this.hello = function() {
      return 'hello!';
    }
  
    this.goodbye = function() {
      return 'goodbye!';
    }
  }
  
  module.exports = greatings;
  </code></pre>
  <p>Then I imported it into <em>main.js</em> in VUE.JS just like:</p>
  <pre><code>import greatings from './assets/js/greatings';
  Vue.use(greatings);
  </code></pre>
  <p>Now I would like to use it in my components but if I do it I got an error:</p>
  <pre><code>  mounted() {
      this.greatings.hello();
    }
  </code></pre>
  <blockquote>
  <p>ERROR: Error in mounted hook: &quot;TypeError: Cannot read property 'hello' of undefined&quot;</p>
  </blockquote>
  <p>How to fix it and be able to use my greatings?
  Thanks for any help!</p>