history is functionnal and with state transition

This commit is contained in:
2019-09-25 16:08:58 +02:00
parent 1957aa3dc5
commit b272bca0ca
12 changed files with 279 additions and 86 deletions
+11 -7
View File
@@ -15,6 +15,9 @@
</template>
<script>
import { mapActions } from 'vuex'
export default {
name: 'ResultItem',
props: {
@@ -23,16 +26,17 @@ export default {
required: true
}
},
data: () => ({
}),
methods: {
...mapActions({
addHistoryItem: 'History/addItem'
}),
onclick () {
console.log('clicked on result item', this.result)
this.$router.push({
name: `item`,
params: { uuid: this.result.uuid }
})
this.addHistoryItem(this.result)
// this.$router.push({
// name: `item`,
// params: { uuid: this.result.uuid }
// })
}
}
}