title: Store vuex Cannot read property 'store' of undefined"
body: <p>I tried to create a first simple App but I have a problem with store.</p>
  
  <p>I have in mainJS </p>
  
  <pre><code>import Vue from 'vue'
  import Vuex from 'vuex'
  import App from './App'
  import router from './router'
  
  Vue.use(Vuex);
  
  
  import {store} from './Store.js';
  store.commit('increment')
  
  new Vue({
    el: '#app',
    router,
     store,
    template: '&lt;div&gt;&lt;App&gt;&lt;/App&gt;&lt;/div&gt;',
    components: { App }
  });
  </code></pre>
  
  <p>So in my <strong>store.js</strong></p>
  
  <pre><code>import Vue from 'vue';
  import Vuex from 'vuex';
  Vue.use(Vuex);
  
  export const store = new Vuex.Store({
      state: {
          count: 0
      },
      mutations: {
          increment (state) {
              state.count++
          }
      }
  });
  </code></pre>
  
  <p>So I would create a child component of App Component that use a event <strong>increment</strong>, so I have created a Component <strong>Counter</strong></p>
  
  <pre><code>&lt;template&gt;
      &lt;div&gt;{{ count }}&lt;/div&gt;
  &lt;/template&gt;
  &lt;script&gt;
  
  export default {
  
      name: "Counter",
      computed: {
          count () {
              return this.$.store.state.count
          }
      }
  
  }
  &lt;/script&gt;
  </code></pre>
  
  <p>And I call this component from my App component that it is:</p>
  
  <pre><code>&lt;template&gt;
    &lt;div id="app"&gt;
      &lt;img src="./assets/logo.png"&gt;
      &lt;router-view/&gt;
      &lt;Counter&gt;&lt;/Counter&gt;
    &lt;/div&gt;
  &lt;/template&gt;
  
  &lt;script&gt;
  import Counter from './components/Counter.vue'
  export default {
    name: 'app',
    components:{
        Counter
    }
  }
  &lt;/script&gt;
  </code></pre>
  
  <p>But I have this error in my <strong>Counter</strong>  component:</p>
  
  <blockquote>
    <p>[Vue warn]: Error in render: "TypeError: Cannot read property 'store'
    of undefined"</p>
    
    <p>found in</p>
    
    <p>--->  at src\components\Counter.vue
            at src\App.vue
             </p>
  </blockquote>