Vuex. How to render data from store using v-for

半世苍凉 提交于 2019-12-06 12:08:00

if you are using a module then you need to of configured that within your store:

# your Vuex store
import shows from './VueX/Modules/shows.js'
export default new Vuex.Store({
  modules: {
    shows,
  },
  ...

Then when you reference it within a component you call the module not the root state:

export default {
  name: 'dashboard',
  components: { ReportIssue, InviteFriend },
  computed: mapState({
    shows: ({ shows }) => shows.shows
  })
}

You probably want to rename the module so to avoid shows.shows but you should get the idea

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!