1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
|
addTest()
{
if(this.optionTest){
this.optionTest.push(this.test)
localStorage.setItem("test",JSON.stringify(this.optionTest))
console.log(this.optionTest)
}else{
//this.priceLocalStorage = [];
this.optionTest.push(this.test)
localStorage.setItem("test",JSON.stringify(this.optionTest))
console.log(this.optionTest)
}
}
deleteOption(index){
this.test = localStorage.getItem('test')
test.splice(index, 1)
// this.ind = this.test[0].index,
// localStorage.removeItem(this.ind,'test')
} |
Partager