<template>
  <view>
    <branchOne
      v-if="!loading && active == 0"
      :carVideoList="typeList[0].children"
    ></branchOne>
    <branchOne
      v-if="!loading && active == 3"
      :carVideoList="typeList[3].children"
    ></branchOne>
  </view>
</template>

<script>
import branchOne from "./components/branchOne.vue";
export default {
  data() {
    return {
      query: {},
      active: 0,
      typeList: [
        {
          id: 1,
          typeName: "科目一",
          pid: 0,
          typeDescribe: null,
          typeIcon: null,
          typeSort: 0,
          status: "0",
          children: [],
        },
        {
          id: 2,
          typeName: "科目二",
          pid: 0,
          typeDescribe: null,
          typeIcon: null,
          typeSort: 0,
          status: "0",
          children: [],
        },
        {
          id: 3,
          typeName: "科目三",
          pid: 0,
          typeDescribe: null,
          typeIcon: null,
          typeSort: 0,
          status: "0",
          children: [],
        },
        {
          id: 4,
          typeName: "科目四",
          pid: 0,
          typeDescribe: null,
          typeIcon: null,
          typeSort: 0,
          status: "0",
          children: [],
        },
      ],
      loading: true,
    };
  },
  onLoad(query) {
    this.query = query;
    this.active = query.active;
  },
  components: {
    branchOne,
  },
  async mounted() {
    let { data } = await this.$api.carVideo.getTreeList();
    this.typeList = data;
    this.loading = false;
  },
};
</script>

<style lang="less" scoped>
</style>