kdh7031
@kdh7031
Reviews Written
1
Average Rating
5.0
Posts
Q&A
error 'index' is defined but never used no-unused-vars ๊ฐ ๋์ต๋๋ค.
๋ต๋ณ ์ฃผ์ ์ ๊ฐ์ฌํฉ๋๋ค. ๊ทธ๋ฐ๋ฐ ๊ธฐ๋ฅ ์ถ๊ฐํ๊ฒ๋ค์ค์์ ์ฒดํฌ์์ด์ฝ์ ํด๋ฆญํ๋ฉด ์๋ฌด๋ฐ ๋ฐ์์ด ์ผ์ด๋์ง ์์ต๋๋ค.
- 2
- 4
- 2.9K
Q&A
error 'index' is defined but never used no-unused-vars ๊ฐ ๋์ต๋๋ค.
ํน์๋ชฐ๋ผ ์ ์ฒด์์ค ์ฌ๋ ค๋๋ฆด๊ฒ์ฉ v-for="(todoItem, index ) in todoItems" v-bind:key="todoItem.item" class="shadow"> class="checkBtn fas fa-check" v-bind:class="{checkBtnCompleted: todoItem.completed}" v-on:click="toggleComplete(todoItem, index)"> v-bind:class="{textCompleted: todoItem.completed}">{{ todoItem.item }} class="removeBtn" v-on:click="removeTodo(todoItem, index)"> class="fas fa-trash-alt"> export default { data: function(){ return { todoItems: [] } }, methods: { removeTodo: function(todoItem, index){ localStorage.removeItem(todoItem); this.todoItems.splice(index, 1); }, toggleComplete: function(todoItem, index){ todoItem.completed = !todoItem.completed; localStorage.removeItem(todoItem.item); localStorage.setItem(todoItem.item, JSON.stringify(todoItem)); } }, created: function () { if(localStorage.length > 0){ for (var i=0;ilocalStorage.length;i++){ if (localStorage.key(i) !== 'loglevel:webpack-dev-server'){ this.todoItems.push(JSON.parse(localStorage.getItem(localStorage.key(i)))); } } } } }scoped> ul{ list-style-type:none; padding-left: 0px; margin-top: 0; text-align: left; } li { display: flex; min-height: 50px; height: 50px; margin: 0.5rem 0; padding: 0 0.9rem; background: white; border-radius: 5px; } .removeBtn { margin-left: auto; color: #de4343; } .shadow { box-shadow: 5px 10px 10px rgba(0,0,0,0.03); } .checkBtn { line-height: 45px; color: #63acde; margin-right:5px; } .checkBtnCompleted { color: #b3adad; } .textCompleted { text-decoration: line-through; color: #b3adad; }
- 2
- 4
- 2.9K
Q&A
VueCLI ๋ฒ์ ์ง๋ฌธ๋๋ฆฝ๋๋ค.
intellij ์๋ vscode ์ ์๋ vetur๊ฐ์ ํ๋ฌ๊ทธ์ธ์ด ์์๊น์? ์ธํ ๋ฆฌ์ ์ด ์๋ veutr์ด ์๋๊ฒ ๊ฐ์์์. `vue` ๋ `scf`๊ฐ์ ๋จ์ถํค๊ฐ ์๋จนํ๋ค์.
- 1
- 4
- 635
Q&A
VueCLI ๋ฒ์ ์ง๋ฌธ๋๋ฆฝ๋๋ค.
๋น ๋ฅธ๋ต๋ณ ๊ฐ์ฌํฉ๋๋ค.!
- 1
- 4
- 635




