title: How to accessing mapState in Vuex and render it to view
body: <p>i’m trying to return all data from API to my views with Axios and using Vuex to store my state.
  This source code can return ‘’‘console.log’’’ but it can’t pass to view.</p>
  
  <p>I had try change mounted() to change() but it still don't working</p>
  
  <p>Here my source code :
  In ‘./store/modules/form.js’ :</p>
  
  <pre><code>import Vue from "vue";
  import axios from "axios";
  import VueAxios from "vue-axios";
  Vue.use(VueAxios, axios);
  
  const state = {
    posts: [],
  };
  const mutations = {
    setPosts(state, posts) {
      state.posts = posts;
    }
  };
  const actions = {
    loadPosts({ commit }) {
      axios
        .get("https://jsonplaceholder.typicode.com/posts")
        .then(response =&gt; resnponse.data)
        .then(posts =&gt; {
          commit("setPosts", posts);
          console.log(posts);
        });
    }
  };
  export default {
    //namespaced: true,
    state,
    mutations,
    actions
  };
  </code></pre>
  
  <p>In './store/index.js :</p>
  
  <pre><code>import Vuex from "vuex";
  import Vue from "vue";
  import form from "./modules/form";
  import axios from "axios";
  import VueAxios from "vue-axios";
  Vue.use(VueAxios, axios);
  Vue.use(Vuex);
  
  export default new Vuex.Store({
    modules: {
      form
    }
  
  });
  </code></pre>
  
  <p>In ‘components/Posts.vue’ :</p>
  
  <pre><code>&lt;template&gt;
    &lt;div&gt;
      &lt;div class="container"&gt;
        &lt;table class="table table-striped"&gt;
          &lt;thead&gt;
            &lt;tr&gt;
              &lt;th&gt;ID&lt;/th&gt;
              &lt;th&gt;Title&lt;/th&gt;
              &lt;th&gt;Body&lt;/th&gt;
            &lt;/tr&gt;
          &lt;/thead&gt;
          &lt;tbody&gt;
            &lt;tr v-for="post in posts" :key="post.id"&gt;
              &lt;td&gt;{{ post.id }}&lt;/td&gt;
              &lt;td&gt;{{ post.title }}&lt;/td&gt;
              &lt;td&gt;{{ post.body }}&lt;/td&gt;
            &lt;/tr&gt;
          &lt;/tbody&gt;
        &lt;/table&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/template&gt;
  
  &lt;script&gt;
  import { mapState } from "vuex";
  export default {
    name: "PostsPage",
    computed: mapState(["posts"]),
    mounted() {
      this.$store.dispatch("loadPosts");
    },
  };
  &lt;/script&gt;
  </code></pre>
  
  <p>Thank you so much if you can help me.</p>