<template>
    <div class="dv-section-parameter-select-item"
         @click="handleClick"
         :class="{active: currentValue === value}">
        <slot></slot>
    </div>
</template>

<script>
    export default {
        name: 'DvSectionParameterSelectItem',
        inject: ['selectParameterSelect'],
        props: {
          value: null
        },
        computed: {
            currentValue () {
                return this.selectParameterSelect.currentValue;
            }
        },
        methods: {
            handleClick () {
                this.selectParameterSelect.select(this.value);
            }
        },
        mounted() {
            this.selectParameterSelect.addItem(this.value);
        }
    };
</script>
