53 lines
1.1 KiB
Vue
53 lines
1.1 KiB
Vue
<template>
|
|
<div class="flex-1 overflow-auto p-4">
|
|
<woot-button
|
|
color-scheme="success"
|
|
class-names="button--fixed-top"
|
|
icon="add-circle"
|
|
@click="openAddPopup"
|
|
>
|
|
{{ buttonText }}
|
|
</woot-button>
|
|
<campaign />
|
|
<woot-modal :show.sync="showAddPopup" :on-close="hideAddPopup">
|
|
<add-campaign @on-close="hideAddPopup" />
|
|
</woot-modal>
|
|
</div>
|
|
</template>
|
|
|
|
<script>
|
|
import campaignMixin from 'shared/mixins/campaignMixin';
|
|
import Campaign from './Campaign.vue';
|
|
import AddCampaign from './AddCampaign';
|
|
|
|
export default {
|
|
components: {
|
|
Campaign,
|
|
AddCampaign,
|
|
},
|
|
mixins: [campaignMixin],
|
|
data() {
|
|
return { showAddPopup: false };
|
|
},
|
|
computed: {
|
|
buttonText() {
|
|
if (this.isOngoingType) {
|
|
return this.$t('CAMPAIGN.HEADER_BTN_TXT.ONGOING');
|
|
}
|
|
return this.$t('CAMPAIGN.HEADER_BTN_TXT.ONE_OFF');
|
|
},
|
|
},
|
|
mounted() {
|
|
this.$store.dispatch('campaigns/get');
|
|
},
|
|
methods: {
|
|
openAddPopup() {
|
|
this.showAddPopup = true;
|
|
},
|
|
hideAddPopup() {
|
|
this.showAddPopup = false;
|
|
},
|
|
},
|
|
};
|
|
</script>
|