강의

멘토링

커뮤니티

인프런 커뮤니티 질문&답변

우주먼지님의 프로필 이미지
우주먼지

작성한 질문수

Vue.js 중급 강좌 - 웹앱 제작으로 배워보는 Vue.js, ES6, Vuex

[리팩토링 & 퀴즈] mapMutations 적용 및 퀴즈

콘솔창 에러

작성

·

382

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>

답변 1

0

캡틴판교님의 프로필 이미지
캡틴판교
지식공유자

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

우주먼지님의 프로필 이미지
우주먼지

작성한 질문수

질문하기