2017-06-29 08:11:46 +00:00
|
|
|
<template>
|
2017-06-30 15:04:01 +00:00
|
|
|
<button @click="download" aria-label="Download" title="Download" class="action">
|
|
|
|
<i class="material-icons">file_download</i>
|
|
|
|
<span>Download</span>
|
|
|
|
<span v-if="selectedCount > 0" class="counter">{{ selectedCount }}</span>
|
|
|
|
</button>
|
2017-06-29 08:11:46 +00:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2017-06-30 15:04:01 +00:00
|
|
|
import {mapGetters, mapState} from 'vuex'
|
2017-06-29 08:11:46 +00:00
|
|
|
|
|
|
|
export default {
|
|
|
|
name: 'download-button',
|
2017-06-30 15:04:01 +00:00
|
|
|
computed: {
|
|
|
|
...mapState(['req']),
|
|
|
|
...mapGetters(['selectedCount'])
|
|
|
|
},
|
2017-06-29 08:11:46 +00:00
|
|
|
methods: {
|
|
|
|
download: function (event) {
|
2017-06-30 15:04:01 +00:00
|
|
|
if (this.req.kind !== 'listing') {
|
|
|
|
window.open(`${window.location.pathname}?download=true`)
|
2017-06-29 08:11:46 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2017-06-30 15:04:01 +00:00
|
|
|
this.$store.commit('showDownload', true)
|
2017-06-29 08:11:46 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|