<template>
  <div class="container">
    <search-fold></search-fold>
    <file-list :mode="'favorShare'" :list="fileList" @handleClickItem="toggleShowBtn" @handleOpen="openFile"></file-list>
  </div>
</template>

<script>
export default {
    name: 'FavorShare',
    components: {
        FileList: () => import('./components/FileList'),
        SearchFold: () => import('./components/SearchFold')
    },
    data () {
        return {
            fileList: [
                {
                    name: '我收藏的.docx',
                    icon: 'document',
                    fileType: 'myFavor',
                    showFunBtn: false
                },
                {
                    name: '我分享的.docx',
                    icon: 'document',
                    fileType: 'myShare',
                    showFunBtn: false
                },
                {
                    name: '分享给我的.docx',
                    icon: 'document',
                    fileType: 'shareToMe',
                    showFunBtn: false
                }
            ]
        }
    },
    methods: {
        toggleShowBtn (item) {
            /* 显示功能按钮 */
            item.showFunBtn = !item.showFunBtn
        },
        openFile (item) {
            /* 打开文档 */
            this.$router.push({
                path: '/education/documentDetail'
            })
        }
    },
    created () {
    },
    mounted () {
    }
}
</script>

<style lang="less" scoped>
.content {
    background: white;
}
</style>
