<template>
    <div>Demo 更改Table显示</div>
</template>

<script>
export default {
    name: 'index',
    inject: ['currentComponent', 'refresh'],
    data() {
        return {};
    },
    mounted() {
        this.hasPermission();
    },
    methods: {
        hasPermission() {
            let allComponents = this.currentComponent();
            allComponents.forEach((item) => {
                if (item.name === 'Table') {
                    item.hidden = false;
                }
            });
            console.log(allComponents);
            /**
             * 第一种方法：直接调用refresh方法刷新页面
             */
            // this.refresh();
        },
    },
};
</script>

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