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