Fetch in Pages Vuex Store

  • Pre-fill store before rendering
  • Similar to asyncData
export default {
  async fetch ({ store }) {
    const data = await get('/api/products')
    store.commit('products/add', data)
  }
}