<template>
  <component :is="parentObj.activeName"/>
</template>

<script>
import List from './components/List'
import Add from './components/add'
import RecordList from './components/RecordList'
export default {
  components: {
    List,
    RecordList,
    Add
  },
  data() {
    return {
      parentObj: {
        activeName: 'List',
        USER_ID: '',
        TYPE: ''
      }
    }
  },
  methods: {
    setActiveName(activeName) {
      this.parentObj.activeName = activeName
    },
    setUserId(USER_ID) {
      this.parentObj.USER_ID = USER_ID
    },
    setType(TYPE) {
      this.parentObj.TYPE = TYPE
    }
  },
  provide() {
    return {
      parentObj: this.parentObj,
      setActiveName: this.setActiveName,
      setType: this.setType,
      setUserId: this.setUserId
    }
  }
}
</script>

<style scoped>

</style>
