<template>
  <div class="container">
    <component :is="componentVal" @change="changePage" @recordPageInfo="recordPageInfo"></component>
  </div>
</template>

<script>
import { satelliteIntroduction } from "@/utils/formDatas.js"
import { page, update } from "@/api/website/satelliteIntroduction"

import List from "./list"
import Edit from "./edit"

export default {
  name: "satelliteIntroduction",
  components: {
    List,
    Edit
  },
  data() {
    return {
      componentVal: 'List',
      datas: null,
      pageInfo: {
        status: null,
        name: null,
        page: 1,
        limit: 10
      }
    }
  },
  mounted() {

  },
  methods: {
    recordPageInfo(page) {
      this.pageInfo.status = page.status || null;
      this.pageInfo.name = page.name || null;
      this.pageInfo.page = page.page;
      this.pageInfo.limit = page.limit;
    },
    changePage(name, val = null) {
      this.componentVal = name
      this.$nextTick(() => {
          if (name == 'Edit' && val) {
            this.$bus.$emit('satelliteIntroduction-edit-renderData', val)
          }
      })
    }
  }
}
</script>

<style lang="scss" scoped>

</style>
