묻고 답해요
129만명의 커뮤니티!! 함께 토론해봐요.
인프런 TOP Writers
-
미해결실습 UI 개발로 배워보는 순수 javascript 와 VueJS 개발
에러가 나네요
안녕하세요, 크롬 사용해 로컬 띄우고 있는데, console.log로 찍은 소스가 크롬 console창에 안찍히고 에러가나네요. 이거 해결할수 있는 방법 있을까요? 크롬은 최신버전입니다.
-
미해결Vue.js 완벽 가이드 - 실습과 리팩토링으로 배우는 실전 개념
Elements in iteration expect to have 'v-bind:key' directives. 에러 발샐 질문
<template> <div> <div v-for="user in users">{{ user.title }}</div> </div> </template> <script> import axios from 'axios'; export default { data() { return { users: [] } }, created() { var vm = this; axios.get('https://api.hnpwa.com/v0/news/1.json') // es5 문법 .then(function(response){ console.log(response); vm.users = response.data; }) .catch(function(error){ console.log(error); }) // es6 문법 // .then(response => vm.users = response.data) // .catch() }, } 코드를 이렇게 작성했는데.. <div v-for="user in users">{{ user.title }}</div> 부근에서 에러가 발생합니다. 에러 내용은 Elements in iteration expect to have 'v-bind:key' directives. 라는 에러가 발생하는데 어떻게 해결해야 하나요 ?