강의

멘토링

커뮤니티

Inflearn Community Q&A

sserenityy's profile image
sserenityy

asked

Vue.js Intermediate Course - Learn Vue.js, ES6, and Vuex by creating a web app

[Refactoring & Quiz] Applying mapMutations and Quiz

콘솔창 에러

Written on

·

381

1

좋은 강의 감사합니다!! map 적용 후부터 콘솔 창에

[Vue warn]: <transition-group> children must be keyed: <li>

이렇게 오류가 뜨는데 이유가 뭘까요...?

 

<template>

  <div>

    <transition-group name="list" tag="ul">

      <li

        v-for="(todoItem, index) in this.storedTodoItems"

        :key="todoItem.item"

        class="shadow"

      >

        <i

          class="checkBtn fas fa-check"

          v-bind:class="{ checkBtnCompleted: todoItem.completed }"

          @click="toggleComplete(todoItem, index)"

        ></i>

        <span v-bind:class="{ textCompleted: todoItem.completed }">

          {{ todoItem.item }}

        </span>

        <span class="removeBtn" @click="removeTodo({ todoItem, index })">

          <i class="fas fa-trash-alt"></i>

        </span>

      </li>

    </transition-group>

  </div>

</template>

vuejses6vuexjavascript

Answer 1

0

captain님의 프로필 이미지
captain
Instructor

안녕하세요 ming님, v-for 디렉티브는 항상 v-bind:key와 같이 사용하셔야 합니다. 이후 강의 로드맵에 추가로 안내되어 있으니 참고해 주시면 좋을 것 같아요 :)

sserenityy's profile image
sserenityy

asked

Ask a question