title: NUXTJS share JS method with Store Getters
body: <p>I want to write a simple JS method that I will use both in Store GETTERS.</p>
  <p>I created a new file: <code>/plugins/myMethod.js</code> and added it to <code>nuxt.config.js</code> (at plugins part).</p>
  <p>Follows the content of the file:</p>
  <pre><code>export default ({ app }, inject) =&gt; {
    // Inject $hello(msg) in Vue, context and store.
    inject('exportaData', msg =&gt; console.log(`Data is: ${msg}!`))
  }
  </code></pre>
  <p>I can use this method in Vue Components and in store ACTIONS, but not in Store GETTERS. I tried <code>this.$myMethod(1)</code> without any success.</p>
  <p>Follows the code of <code>store/data.js</code></p>
  <pre><code>export const getters = {
      hoje: state =&gt; {
        console.log('Running getter HOJE')
        this.$exportaData('12345')
      },
  }
  </code></pre>
  <p>and in my Vue component:</p>
  <pre><code>&lt;p&gt;DATA: {{ $store.getters['datas/hoje'] }}&lt;/p&gt;
  </code></pre>
  <p>Any idea how to access my custom method in the store getter?</p>
  <p>Thanks</p>