<template>
  <div class="container">
    <el-tabs v-model="activeName">
      <el-tab-pane name="byFile">
        <span slot="label"><i class="el-icon-document"></i> 按文件分类</span>
        <NoteByFile ref="NoteByFile" />
      </el-tab-pane>
      <el-tab-pane name="byTag">
        <span slot="label"><i class="el-icon-price-tag"></i> 按标签分类</span>
        <NoteByTag ref="NoteByTag" />
      </el-tab-pane>
    </el-tabs>
  </div>
</template>
<script>
import NoteByFile from "./components/noteByFile.vue";
import NoteByTag from "./components/noteByTag.vue";
export default {
  components: {
    NoteByFile,
    NoteByTag,
  },
  data() {
    return {
      activeName: "byFile",
    };
  },
  watch: {
    activeName(value) {
      if (value == "byFile") {
        this.$refs.NoteByFile.loadfileList();
      } else {
        this.$refs.NoteByTag.loadtagList();
      }
    },
  },
};
</script>
<style lang="scss" scoped>
.container {
  // padding: 10px 0;
}
::v-deep .el-tabs__header {
  padding: 0 20px;
  margin: 0 !important;
}
::v-deep .el-tab-pane {
  height: calc(100vh - 138px);
}
</style>
