<template>
    <view class="easy-table-thead">
        <slot></slot>
    </view>
</template>

<script>
    export default {
        name: 'easyTableThead',
        props: {
            checked: {
                type: Boolean,
                default: false
            }
        },
        data() {
            return {}
        },
        created() {
            this.root = this.getTable();
        },
        methods: {
            /**
             * 获取父元素实例
             */
            getTable(name = 'easyTable') {
                let parent = this.$parent;
                let parentName = parent.$options.name;
                while (parentName !== name) {
                    parent = parent.$parent;
                    if (!parent) return false;
                    parentName = parent.$options.name;
                }
                return parent;
            }
        }
    }
</script>

<style lang="scss">
</style>