yearS.vue 1.34 KB
<template>
    <keep-alive>
       <component :emitData="emitData" :is="reportVal" :key="reportVal"></component>
    </keep-alive>
</template>

<script>
// import ipageOption from '../common/option/optionMall.vue';
import yearCount from './year_count';
import yearDetail from './year_detail';
export default {
    props: {
      propparam: {
        type: Object,
        default: () => {}
      }
    },
    data() {
        return {
            reportVal:'count',
            emitData:{}
        }
    },
    components: {
        // ipageOption,
        count:yearCount,
        detail:yearDetail
    },
    watch: {
      propparam: {
        handler: "refreshHandle",
        immediate: true
      }
    },
    methods: {
      refreshHandle(data){
        console.log(data)
        this.emitData = data;
      },
        // reportData(emitData){
        //    // this.reportVal = emitData.radio;
        //    if(emitData.dateType=='custom'){
        //      emitData.dateType = 'month'
        //    }
        //    this.emitData = emitData;
        //    if('year' == emitData.dateType){
        //      this.emitData = emitData;
        //    }else{
        //      this.$router.push({name:'ipagemall'+emitData.dateType,params:emitData});
        //    }
        // }
    },
    created() {

    },
    mounted() {

    }
}
</script>

<style scoped>

</style>