K
K
Kirill Gorelov2020-12-02 06:19:14
Vue.js
Kirill Gorelov, 2020-12-02 06:19:14

Duplicate keys detected: 'x'. This may cause an update error?

Hi guys.

Our frontent "master", either does not understand, or does not want to solve the problem .....
5fc706b2e8b17801337528.png

I myself am zero in vue, but nevertheless, I myself am responsible for the project. So I need to do it.

There is a list template

<script type="text/template" id="cat-item_tpl">
    <article class="cat-item">
        <a :href="itemdata.link" class="cat-item_link" title="На страницу товара">
        <template v-if="itemdata.imgReplace">
            <figure class="cat-item_img">
                <img :src="itemdata.img" class="img-fluid" :alt="itemdata.imgAlt">
                <img :src="itemdata.imgReplace" class="img-fluid cat-item_img-replace" :alt="itemdata.imgReplaceAlt">
            </figure>
        </template>
        <template v-else>
            <figure class="mb15proc">
                <img :src="itemdata.img" class="img-fluid" :alt="itemdata.imgAlt">
            </figure>
        </template>
        </a>
    </article>
</script>


And output loop
<template v-if="cat_items_sorted.length">
                    <div is="cat-item" :itemdata="item" v-for="(item, idx) in cat_items_sorted" :key="item.id">
                    </div>
                </template>
                <template v-else>
                    <p class="text-muted h5">Ничего не найдено :(</p>
                </template>


All unique ids come from the server, I checked it several times. But all the same, duplicates are substituted.
Don't know how to fix it.
Googled, but there id really repeats .....

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
Kirill Gorelov, 2020-12-02
@Kirill-Gorelov

It was not a reel, it was my hands that were crooked ((((
At the first load, the catalog was sorted by name. And when scrolling, by internal sorting. I forgot that it was also necessary to change the sorting at the front, it turned out that the goods went first by name and when loading, he was the first in sorting ..... That 's
the kind of hat I had .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question