2
동적 항목 추가 및 제거가 작동 중입니다. 나는 각각 아래에 요소를 추가/숨기고 싶다. 그러나, 내가 "보여주기/숨기기"할 때 모든 것을 토글합니다. (? 방법 토글) 어떻게 여기Vuejs 상태 표시/숨기기
var app = new Vue({
el: '#app',
data: {
inputProject: [],
counter:0,
active : false
},
methods: {
addInput: function() {
this.inputProject.push(this.counter);
this.counter++
},
removeInput: function(index) {
this.inputProject.splice(index,1);
},
toggle: function (index) {
this.active = !this.active;
}
}
})
Jsfiddle는 현재 인덱스를 호출 할 수 있습니다 https://jsfiddle.net/rhgz83e2/30/