<template>
  <pc v-if="isPC" :com="com" :dev="dev"></pc>
  <mobile v-else :com="com" :dev="dev"></mobile>
</template>

<script>
import { mapState } from 'vuex'
import http from '@/plugins/http'
import pc from '@/components/type/vip/pc'
import mobile from '@/components/type/vip/mobile'

export default {
  head: {
    title: '会员中心页 - 程序员客栈',
  },
  components: {
    pc,
    mobile,
  },
  data() {
    return {
      vipList: []
    }
  },
  computed: {
    ...mapState(['isPC']),
    com() {
      return this.vipList[0];
    },
    dev() {
      return this.vipList[1];
    }
  },
  mounted() {
    this.getList()
  },
  methods: {
    async getList() {
      let res = await http.get(`/api/vip/getList`)
      if(res) {
        this.vipList = res.data
      }
    }
  }
}
</script>

<style>
</style>
