Last active
April 4, 2017 18:59
-
-
Save lkostrowski/57ed8456f19f31c9f069b080c085aeb1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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