xgqfrms™, xgqfrms® : xgqfrms's offical website of cnblogs! xgqfrms™, xgqfrms® : xgqfrms's offical website of GitHub!

v-for & duplicate key bug

v-for & duplicate key bug

vue warn & v-for & duplicate key bug


    <span class="audit-common-lable">优先级</span>
    <h-select
        aria-placeholder="优先级"
        placeholder="请选择优先级"
        style="width:205px"
        v-model="commonFilters.priority"
        filterable
        clearable>
        <h-option
            v-for="item in priorities"
            :value="item.value"
            :key="item.value">
            {{item.title}}
        </h-option>
    </h-select>

solution

index & unique key


    <span class="audit-common-lable">优先级</span>
    <h-select
        aria-placeholder="优先级"
        placeholder="请选择优先级"
        style="width:205px"
        v-model="commonFilters.priority"
        filterable
        clearable>
        <h-option
            v-for="(item, i) in priorities"
            :value="item.value"
            :key="i">
            {{item.title}}
        </h-option>
    </h-select>

posted @ 2019-01-08 16:59  xgqfrms  阅读(320)  评论(1编辑  收藏  举报