내가이 나는 독특한 통해 삭제하여 현재 생성 된 목록을 제거하기 위해 어떤 조건에 그러나 원하는 배열 myList를 에 추가됩니다타이프 라이터
this.mylist.push([{key:{"test1":name,"test":desc,"hi i am a test":other,"none":type,"amount":0} }]);
이 변수가 있다고 가정하자 키 부모를 통해 객체 배열을 제거 나는 값이 나는
시도 중복을을 방지하기 위해 제거 할 수 있도록 객체 배열을 스플 라이스 할
있도록 키
하지만 난이 아이를 보유하고있는 고유 키를 얻어서 배열을 제거하려고 을 작동하지 않았다 나는 또한 :(
나를 도울 수 this.mylist.splice(this.mylist.indexOf([{key}]), 1);
사람을 시도
값
CheckBox(values,values,values) {
this.bool = (this.mylist.indexOf(key) === -1);
if (this.bool) {
this.mylist.push([{key:{"key":key,"naam":naam,"beschrijving":beschrijving,"type":type,"aantal":aantal} }]);
}
else {
this.mylist.splice(this.mylist.indexOf(key), 1);
}
}
위 기능은 사용자가 체크 박스를 클릭 할 때 발생하는 이벤트입니다. true 인 경우 배열은 값으로 채워야합니다. 다른 고유 키 배열이 푸시 문 후 중복을