<template>
  <div class="app-container">
    <el-tabs v-model="tabActive">
      <el-tab-pane label="别人分享给我的" name="shareFrom">
        <ShareFrom ref="ShareFrom" />
      </el-tab-pane>
      <el-tab-pane label="我分享的" name="shareTo">
        <ShareTo ref="ShareTo" />
      </el-tab-pane>
    </el-tabs>
  </div>
</template>
<script>
import ShareTo from "./components/shareTo";
import ShareFrom from "./components/shareFrom";
export default {
  components: {
    ShareTo,
    ShareFrom,
  },
  watch: {
    tabActive(value) {
      if (value == "shareFrom") {
        this.$refs.ShareFrom.getList();
      }
      if (value == "shareTo") {
        this.$refs.ShareTo.getList();
      }
    },
  },
  data() {
    return {
      tabActive: "shareFrom",
    };
  },
};
</script>
<style lang="scss" scoped>
.app-container {
  height: 100%;
}
</style>
