Skip to content

Instantly share code, notes, and snippets.

@lkostrowski
Last active April 4, 2017 18:59
Show Gist options
  • Save lkostrowski/57ed8456f19f31c9f069b080c085aeb1 to your computer and use it in GitHub Desktop.
Save lkostrowski/57ed8456f19f31c9f069b080c085aeb1 to your computer and use it in GitHub Desktop.
<template>
... template is the same
</template>
<script>
import eventBus from 'services/event-bus'
export default {
name: 'products-list',
data() {
return {
products: [],
loaded: false
};
},
created() {
eventbus.$emit('basketpage:loaded');
eventBus.$on('basket:loading', () => {
this.loaded = false;
});
eventBus.$on('basket:updated', (data) => {
this.products = data.products;
this.loaded = true;
});
}
};
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment