<template>
    <li class="nus_stickyItem" v-if="itemData">
        <slot :itemKey="itemKey" :itemData="itemData"></slot>
    </li>
</template>

<script>
export default {
    props: {
        /**
         * 索引的key
         */
        itemKey: {
            type: [Number, String]
        },
        /**
         * 当前项数据
         */
        itemData: {},
        /**
         * 当前活动项
         */
        activeIndex: {}
    },
    watch: {
        activeIndex(nowval) {
            if (this.itemKey === nowval) {
                this.$emit('selectChange', nowval);
            }
        }
    }
};
</script>

<style lang="scss">
@import '../../../../../_assets/style/_iconFont.scss';
@import '../../../../../_assets/style/_var.scss';
@import '../../../../../_assets/style/_mixin.scss';

.nus_stickyItem{
    width: 100%;
    text-align: left;
    box-sizing: border-box;
    overflow: hidden;
}
</style>
