<template>
  <component :is="myComponent" ref="detail" />
</template>
<script>
import Cookies from 'js-cookie'
// import dashboardAdmin from './admin'
// import dashboardEditor from './editor'
export default {
  // name: 'Dashboard',
  // components: { dashboardAdmin, dashboardEditor },
  data() {
    return {
      myComponent: null
    }
  },
  mounted() {
    this.detailComponent()
  },
  methods: {
    detailComponent() {
      console.log(Cookies.get('isHomePage'),'isHomePage')
      if (Cookies.get('isHomePage') == 1) {
        const vue = this
        var myComponent = () => import('./editor/index.vue')
        return vue.myComponent = myComponent
      } else {
        const vue = this
        var myComponent = () => import('./admin/index.vue')
        return vue.myComponent = myComponent
      }
    }

  }
}
</script>
