title: using vuejs mixins in js file
body: <p>i have a system in which i have to set up some reusable functions to be used all over my application, now i have created a vue mixin in my main <code>main.js</code> file now when i call that function from vue components it works just fine but when i try to call the same function inside a js file i get an error of <code>undefined</code> here's my code</p>
  
  <p><strong>main.js</strong></p>
  
  <pre><code>Vue.mixin({
  
     methods: {
          test: function () {
              return 1;
          },
     }
  });
  </code></pre>
  
  <p><strong>Vue Components</strong></p>
  
  <pre><code>//this works
      async created() {
          alert(this.test());
      }
  </code></pre>
  
  <p><strong>services.js</strong></p>
  
  <pre><code>import { API } from 'aws-amplify';
  import { Auth } from "aws-amplify";
  
  import axios from 'axios'
  
  export default {
  somefunction(){
  //this doesnot work
   alert(this.test());
  }
  }
  </code></pre>
  
  <p>can someone tell me how can i use vue mixins in regular js files, i looked on the internet but couldn't find anything related to this</p>