<template>
    <div class="go-maxlength-label" :style="maxLabelStyle()">
        {{ (value + "").length }}/{{ maxLength }}
    </div>
</template>

<script>
    export default {
        name: "go-max-length-label",
        props: {
            maxLength: {},
            height: {
                type: Number
            },
            value: {
                type: String
            }
        },
        methods: {
            maxLabelStyle() {
                let top = this.height - 30;
                return {
                    position: "absolute",
                    top: `${top}px`,
                    right: " 5px",
                    display: "block"
                };
            }
        }
    };
</script>
