<template>
  <div>
    <div class="no-style" v-html="campaignHtml"></div>
  </div>
</template>

<script>
import { mapState, mapActions } from "vuex";

export default {
  name: "clientView",
  data() {
    return {};
  },
  methods: {
    ...mapActions("campaign", ["getCampaignHTML"]),
    routerGoTo(goto) {
      this.$router.push(goto);
    }
  },
  mounted() {
    this.getCampaignHTML(this.$route.params.id);
    this.$emit("setLandingPage", true);
    if (!this.campaign.isActive) {
      console.log("reroute to exp");
      this.$router.push("/CampaignExpired");
    }
  },
  computed: {
    ...mapState("campaign", ["campaignHtml"])
  }, 
  destroyed() {
    this.$emit("setLandingPage", false);
  }
};
</script>