title: how to use vuex in vue components?
body: <p>I have a vuex example project:</p>
  
  <p>app.vue:</p>
  
  <pre><code>&lt;template&gt;
      &lt;div&gt;{{message}}&lt;/div&gt;
  &lt;/template&gt;
  
  &lt;script&gt;
  import store from "./app.store.js";
  
  export default {
      computed: { message: () =&gt; store.message }
  }
  &lt;/script&gt;
  </code></pre>
  
  <p>app.store.js:</p>
  
  <pre><code>import Vue from "vue";
  import Vuex from "vuex";
  
  Vue.use(Vuex);
  
  const state = { message: "Hello World" };
  const getters = { message: state =&gt; state.message };
  const store = new Vuex.Store({ state, getters });
  
  export default store;
  </code></pre>
  
  <p>The {{message}} placeholder is replaced with empty string instead of "Hello World". How to use vuex in vue components?</p>