Files
shopify-storefront/pages/index.vue
T
2020-02-25 20:14:23 +01:00

28 lines
518 B
Vue

<template>
<div class="full-width">
<h1>Welcome to my shop</h1>
</div>
</template>
<script>
export default {
async asyncData ({ $shopify }) {
const products = await $shopify.product.fetchAll()
return { products }
},
beforeUpdate () {
if (typeof this.$store.state.checkout.id === 'undefined') {
this.$shopify.checkout.create().then((checkout) => {
this.$store.commit('setCheckout', checkout)
})
}
}
}
</script>
<style>
.full-width {
width: 100%;
}
</style>