<template>
    <div id="docnum-list">
        <h3>{{ messages.get("docnums", "docnum_list") }}</h3>
        <div class="row docnum-list">
            <docnum
                v-for="(docnum, index) in docnums" :key="index"
                @select-docnum="$emit('select-docnum', $event)"
                :idDocnum="docnum.id"
                :name="docnum.name"
            />
        </div>
    </div>
</template>

<script>
import docnum from "./docnum.vue"
export default {
    components: { docnum },
    props: {
        idNotice: {
            type: Number,
            required: true
        }
    },
    data() {
        return {
            docnums: []
        }
    },
    mounted() {
        this.ws.get("docnums", "list/" + this.idNotice)
            .then((response) => this.docnums = response)
            .catch((e) => console.error(e));
    },
    methods: {}
}
</script>