<template>
  <div>
    <FileList />
  </div>
</template>
<script>
import FileList from "@/components/file/FileList.vue";
import { fileTypeConstant } from "@/components/file/constants";
const { MY_COLLECT } = fileTypeConstant;
export default {
  components: {
    FileList,
  },
  data() {
    return {
      isInit: false,
    };
  },
  mounted() {
    this.isInit = false;
    // 读取当前的查询参数
    const currentQueryParams = this.$route.query;

    // 修改查询参数，例如，给 "filePath" 参数设置新的值
    const newFileType = MY_COLLECT;
    const newFilePath = "/我的收藏";
    const newQueryParams = {
      ...currentQueryParams,
      fileType: newFileType,
      filePath: newFilePath,
    };

    // 使用 this.$router.push() 导航到当前路由，并传递新的查询参数
    this.$router.push({ query: newQueryParams });
    this.isInit = true;
  },
};
</script>
