import { defineComponent, ref, onMounted } from 'vue'
import type { IMyPage } from 'model'
import { useGlobalStore } from '@store/globalStore'
import { CImgText } from '@src/components/CImgText'
import { CCard } from '@src/components/CCard'
import { CMyPage } from '@src/components/CMyPage'
import { CTitleBanner } from '@src/components/CTitleBanner'
import { useRouter } from 'vue-router'

export default defineComponent({
  name: 'CMyInnerPage',
  props: {
    path: {
      type: String,
      required: true,
    },
  },
  components: { CImgText, CCard, CMyPage, CTitleBanner },
  setup(props) {
    // const heightimg
    // const imgback
    const rec = ref(<IMyPage | undefined>{})
    const globalStore = useGlobalStore()

    const $router = useRouter()

    function mounted() {
      // console.log('$route.path', $route.path)
      rec.value = globalStore.getPage(props.path)

      console.log('rec', rec)
    }

    onMounted(mounted)

    return {
      rec,
    }
  },

})
